Advertisement
Guest User

Untitled

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