well i have a little script this should execute and install one application but really in the other computer hasn't installed i'll want to install application in the other computer
the files txt have the name of the computer yours hostname, when i execute of the script i look that my computer can connect to other computer by psexec and i can watch that appears on my screen in summary "psexec v2... - execute processes remotly, copyright, sysinternals" but after the application has not installed what i can do? i have problems in the last line
& C:\pstools\psexec.exe -u $user -p $password \$destination\c$ $app
$Computers = Get-content "C:\Users\marc\Documents\computer.txt"
$destination = Get-content "C:\Users\marc\Documents\destination.txt"
$File= "c:\Documents\program.exe"
$app="c:\program.exe /clone_wait /s /v' /qn PROGTYPE=ENTEGRA REBOOT=Supress'"
Foreach ($destination in $Computers) {
$Test = Test-Path -path "\\$destination\c$"
If ($Test -eq $True) {Write-Host "The path exists, the software will be installed in $destination."}
Else {(Write-Host " the path does not exist, therefore it will be created in $destination and the installation will start")}
Echo "Copying Files to C:\$destination"
Copy-Item $File "\\$destination\c$"
echo "Second part : installing the software on $destination"
& C:\pstools\psexec.exe -u $user -p $password \\$destination\c$ $app
}