0

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

Santiago Squarzon
  • 41,465
  • 5
  • 14
  • 37
pesky_programmer
  • 131
  • 3
  • 12
  • 3
    There's not enough information in your question to diagnose your problem. Where are you invoking this from? Please directly update your question with clarifications. – mklement0 Jul 12 '21 at 22:40
  • A quick google will give you the information you need: https://devblogs.microsoft.com/powershell/powershell-constrained-language-mode-and-the-dot-source-operator/ – Scepticalist Jul 13 '21 at 08:40

0 Answers0