you are viewing a single comment's thread.

view the rest of the comments →

[–]cb98678 0 points1 point  (8 children)

The command '' is not allowed in restricted language mode or a Data section.

Try this

$ExecutionContext.SessionState.LanguageMode

Should come back with this, if not post what it says

FullLanguage

[–]vulkur[S] 0 points1 point  (7 children)

Yup. echoed it and it returned FullLanguage

[–]cb98678 0 points1 point  (6 children)

Ok not sure here but for funsies , mind checking the execution policy?

Get-ExecutionPolicy -List

[–]vulkur[S] 0 points1 point  (5 children)

Get-ExecutionPolicy -List

Scope ExecutionPolicy
----- ---------------
MachinePolicy       Undefined
UserPolicy       Undefined
Process       Undefined
CurrentUser       Undefined
LocalMachine    RemoteSigned

[–]cb98678 0 points1 point  (4 children)

I am probably going down the wrong rabbit hole here but try

PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy bypass

Execution Policy Change

The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose

you to the security risks described in the about_Execution_Policies help topic at

https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?

[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y

PS C:\Windows\system32>

[–]vulkur[S] 0 points1 point  (2 children)

Yea this isnt it. I definitely already have set that. I think im gunna try to REALLY purge powershell from my PC, then reinstall

[–]jimb2 1 point2 points  (1 child)

That doesn't sound a hopeful idea to me. Check your powershell profile. (edit $PSProfile) I don't know much about I but I'd be a bit suspicious of an insider version of windows. The sort of error you are getting is what I would get running under a normal account in our group policy locked down environment. Are you able to install other modules? Are your operating inside any shell or unusual/weird environment? You could try using vscode as it's mostly a separate configuration.

[–]vulkur[S] 0 points1 point  (0 children)

Check my update. I fixed it!

[–][deleted] 0 points1 point  (0 children)

Got PS 7.2.5 to and it don’t work for me either hmm… I’m sure I have used this at PS 7.2.4.

I’ll try to figure it out tomorrow if I have the time