Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $proc = (WmiObject Win32_Process -Filter "Name = 'w3wp.exe'" | Where-Object {$_.CommandLine -like "*SomeTextFromCl*"})
- $id = $proc.ProcessId
- $ws = [math]::round((Get-Process -Id $id).WS/1MB)
- Write-Host $ws
- Cannot bind argument to parameter 'Id' because it is null.
- + CategoryInfo : InvalidData: (:) [Get-Process], ParameterBindingValidationException
- + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetProcessCommand
- + PSComputerName : RemoteServerName
- Invoke-Command -ComputerName RemoteServerName -FilePath script.ps1 -Credential $mycredential
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement