I'm trying to access a remote computer using Invoke-Command
but I keep getting the following error:
Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.
I'm not dot sourcing it so I don't get why this error is showing up.
Here's my code:
Invoke-Command -ComputerName $ip -Credential $cred -ScriptBlock {bcdedit /v}
Assume that $ip
and $cred
store valid arguments