Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Why can't I execute this command in PowerShell?

$
0
0

Hello,

I'm trying to execute a program using PowerShell, but didn't get it to work. Any further hints would be appreciated. Thank you.

Code:

$PsExecPath = "C:\PSTools\PsExec.exe"
$ComputersList = Import-Csv C:\Resources\Computers.csv

foreach ($Computer in $ComputersList) {
Write-Host "Processing computer $Computer ..."
."$PsExecPath" -u CONTOSO\Administrator -p P@ssw0rd! -s \\$Computer C:\Windows\system32\ccmsetup\ccmsetup.exe /uninstall
}




Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>