Что я могу добавить, чтобы начать с самого начала после его завершения?Loop script по завершении
mode con: cols=35 lines=5
$tag1 = ""
while (-not ($tag1)) {
$tag1 = Read-Host 'Enter tag # or Q to quit'
}
mode con: cols=80 lines=46
cls
sc.exe \\$tag1 start RemoteRegistry;
cls
start-sleep -seconds 2
cls
$OSInfo = get-wmiobject -class win32_operatingsystem -computername $tag1;
$OSInfo | Format-Table -Property @{Name="OS Name";Expression={$_.Caption}} -AutoSize;
$OSInfo | Format-Table -Property @{Name="System Boot Time";Expression={$_.ConvertToDateTime($_.LastBootUpTime)}} -AutoSize;
$OSInfo | Format-Table -Property @{Name="OS Install Date";Expression={$_.ConvertToDateTime($_.InstallDate)}} -AutoSize;
"`n"
"Current Date & Time: $(Get-Date -Format G)";
"`n"
Get-WmiObject win32_computersystem -Computer $tag1 | Format-Table -Property @{Name="Username";Expression={$_.username}} -Autosize;
Get-EventLog system -computername $tag1 -InstanceId 2147489657 -Newest 10 | format-table EventID,TimeWritten,MachineName -AutoSize;
положить его в петлю – user1336827
Не знаете как, именно поэтому я прошу. – Aaron
Ты хочешь, чтобы он продолжал начисто навсегда? – user1336827