| 1234567891011121314 |
- param(
- $ComputerName,
- $ProgramName,
- $LogFile="runtime/uninstall-package.log"
- )
- $ComputerName | Out-Host
- Invoke-Command -ComputerName $ComputerName -ScriptBlock {
- param($ProgramName)
- hostname
- Get-Package |
- Where-Object {$_.Name -eq $ProgramName} |
- Uninstall-Package -Force
- } -ArgumentList $ProgramName *>&1 | Tee-Object -Append $LogFile
|