Skip to content

Ba4bes/PwshUpdateCheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PWSHUpdateCheck

Build Status

Gallery version Download Status

This Script Checks new PowerShell Core versions and installs them as needed on Windows devices

4bes.nl - Check if there is a Powershell Update describes how to install and use the script

4bes.nl - PowerShell Challenge: Check PWSH version and install describes how the script was created

Find the script in the Gallery

Common setup

Installation

Install the script by using the following line

Install-Script -Name Get-PwshUpdate

Run in a scheduled task or manually. Want to Run it in a scheduled task? Execute the following code:

# Run as administrator!
# Run in Windows PowerShell, this does not work in Core 😭

$InstalledScriptPath = (Get-InstalledScript -Name Get-PwshUpdate).InstalledLocation
$ScriptPath = "$InstalledScriptPath/Get-PwshUpdate.ps1"
#Format as Date-Time
[DateTime]$CheckTime = "10pm"

$Parameters = @{
    "Execute" = "Powershell.exe"
    "Argument" = "-ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -file `" $ScriptPath`" "
}
$Action = New-ScheduledTaskAction @Parameters

$Trigger =  New-ScheduledTaskTrigger -Daily -At $CheckTime

$Parameters = @{
    "Action" =  $Action
    "Trigger"= $Trigger
    "TaskName" = "PWSH Update check"
    "RunLevel" =  "Highest"
    "Description" = "Daily check for PWSH updates"
}

Register-ScheduledTask @Parameters

To Contribute

Any ideas or contributions are welcome! Please add an issue with your suggestions.

Changelog

Version 1.0.1 22/12/2019 Changed handling of the metadata

Version: 1.0 Last update: june 30th 2019 Initial Commit

Known Issues

View known issues here

About

Check for Powershell Updates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published