PowerShell_Scripts/Update-UbuntuOSz.ps1

15 lines
394 B
PowerShell

param(
[ValidateSet('List','Update','Auto','All')]
[string]$Mode = 'List'
)
$script:aptCli = "echo 'not defined'"
switch( $Mode ){
'List' { }
'Auto' { $aptCli = "sudo apt-get update && sudo apt-get upgrade --auto-remove --assume-yes" }
default { $aptCli = "sudo apt-get update && sudo apt-get upgrade --auto-remove " }
}
& sh "-c" "$aptCli" -replace '#args',"$args"