Update-Windows_Powershell.ps1

#Update-Windows_Powershell.ps1
#Updates Windows powershell modules, installs any not installed, and updates help for them all
$modules = $null
$modules = (Get-Module -ListAvailable|select Name -Unique).name
foreach ($module in $modules) {
    Write-Output $module
    Import-Module $module -NoClobber -Verbose -ErrorAction SilentlyContinue;
    if((Get-Module -ListAvailable $module).Version -lt (Get-Module $module).Version){  
        Update-Help -Module $module -Confirm:$false  
    }  
update-module $module -ea Continue  -Verbose -Force -SkipPublisherCheck -Verbose -Confirm:$False -Force -Scope CurrentUser
}

Posted

in

,

by