I want to delete files in a specific folder on a remote server. I am doing the following in Powershell:
Invoke-Command -Computer 'compname1' -ScriptBlock {Remove-Item -$args -force } -ArgumentList 'c:\BizTalkDeployment'
I get the following error:
Cannot find drive. A drive with the name '-c' does not exist.
c: \ BizTalkDeployment is the correct path to compname1 server.
Can someone explain what I did wrong?
source
share