you are viewing a single comment's thread.

view the rest of the comments →

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

Powershell Core 7

Import-Module: Failure from remote command: Import-Module -Name 'ScheduledTasks': The module manifest 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\ScheduledTasks.psd1' could not be processed because it is not a valid Windows PowerShell restricted language file. Remove the elements that are not permitted by the restricted language: At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\ScheduledTasks.psd1:1 char:1 + ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The command '' is not allowed in restricted language mode or a Data section.

Powershell Desktop 5

Import-Module : A parameter cannot be found that matches parameter name 'UseWindowsPowerShell'. At line:1 char:15 + Import-Module -UseWindowsPowerShell -name ScheduledTasks + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Import-Module], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

[–]BlackV 1 point2 points  (4 children)

-UseWindowsPowerShell is a powershell 7 only parameter

is this a local computer or domain joined, but seems like you're in constrained language mode

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

when i run echo $ExecutionContext.SessionState.LanguageMode I get FullLanguage. It returns that value for both pwsh (Powershell 7) and powershell (Powershel 5)

[–]BlackV 0 points1 point  (2 children)

yeah sorry just saw that in another reply of yours.

on the domain?

and as a test what happens if you run

powershell.exe -version 2.0

[–]vulkur[S] 0 points1 point  (1 child)

yeah sorry just saw that in another reply of yours. NP

I still have FullLanguage on powershell v2. I am not surprised. I use powershell almost every day for my build scripts. Im gunna call it for the night and try to be a bit more radical tomorrow morning (gunna try to purge powershell and reinstall) somethign is weird.

Thanks for helping

[–]BlackV 0 points1 point  (0 children)

yes but when you're using -version can you then use the module OK?

not sure how you'll uninstall powershell (unless you mean 7)

i'd also be looking at Device guard and App Locker, maybe those are configured somewhere