首页 > 代码库 > invoke-command

invoke-command

 

invoke-command -ComputerName $server -Credential $cred -ScriptBlock{param($server,$UserName,$serverpass,$starttime,$startdate)
$hotfix_setup = schtasks /query |select-string "hotfix_setup" -quiet
If ($hotfix_setup -eq "true")
{schtasks /delete /tn "hotfix_setup" /f |out-null}
schtasks /create /tn "hotfix_setup" /sc once /ru $UserName /rp $serverpass /st $starttime /sd $startdate /tr D:\Hotfix\Hotfix_Win2003\2014-04\hotfix_setup.bat
} -ArgumentList $server,$UserName,$serverpass,$starttime,$startdate