-
i remak it to this is work ok $PingMachines = Gc "C:\script\computers.txt" ForEach($MachineName In $PingMachines) {$PingStatus = Gwmi Win32_PingStatus -Filter "Address = '$MachineName'" | Select-Object StatusCode If ($PingStatus.StatusCode -eq 0) {Write-Output "$MachineName"...
-
were I am doing wrong $ErrorActionPreference="SilentlyContinue" $computername = Gc "C:\computers.txt" $Process = "\\$computername\f\vmware\start.bat" Trap { Write-Warning "There was an error connecting to the remote computer or creating the process" Continue }...
-
I am trying to use to below Powershell script: get-childitem -Path \\servername\location | where-object {$_.LastWriteTime -lt (get-date).AddDays(-31)} | move-item -destination "C:\Dumps" The script works absolutely fine on testing but its not moving the files in subfolders. Please help....
Posted to
PowerShell for Windows
(Forum)
by
shubh
on
02-18-2013
Filed under: powershell, Powershell scripting Merge VHD, batch multiple command lines powershell windows, command prompt, command, PowerShell v2