Forum Discussion
isht1008
Feb 16, 2023Copper Contributor
Get-ChildItem and Get-WmiObject cim_datafile showing different results
I am using below code to Check if the server is pinging then for Pingable Servers I am checking the Service Status and a file version but I see Get-ChildItem and Get-WmiObject cim_datafile showing di...
diecknet
Feb 17, 2023Iron Contributor
If your chosen cmdlet doesn't support executing against a remote system, you can try PowerShell Remoting.
Essentially:
Invoke-Command -ComputerName $YOUR_REMOTE_SERVER -Command {YOUR COMMAND}
More infos in the docs: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote?view=powershell-5.1