|
|
@@ -4,14 +4,11 @@ param(
|
|
|
$LogFile="runtime/uninstall-package.log"
|
|
|
)
|
|
|
$ComputerName | Out-Host
|
|
|
-# $psremoteremote = Resolve-Path "$PSScriptRoot\..\localadmin\psremote-remote.ps1"
|
|
|
|
|
|
-# &$psremoteremote -ComputerName $ComputerName
|
|
|
-
|
|
|
-# "NetPhone Client"
|
|
|
Invoke-Command -ComputerName $ComputerName -ScriptBlock {
|
|
|
+ param($ProgramName)
|
|
|
hostname
|
|
|
Get-Package |
|
|
|
- Where-Object {$_.Name -eq $ProgramName} |
|
|
|
- Uninstall-Package -Force
|
|
|
-} *>&1 | Tee-Object -Append $LogFile
|
|
|
+ Where-Object {$_.Name -eq $ProgramName} |
|
|
|
+ Uninstall-Package -Force
|
|
|
+} -ArgumentList $ProgramName *>&1 | Tee-Object -Append $LogFile
|