So when I’m entering Environment in the Admin page I do see the following banner:
Windows PowerShell Compatiblity is enabled. We recommend disabling this feature of PowerShell when using PowerShell Universal.
But I can’t figure out how to disable it? I have read the MS article about it but I still don’t get it.
Can anyone give me help with this? some kind of instructions?
@adam is it still “safe” (as in, not a performance hit as time goes on) to use -UseWindowsPowerShell for relevant scripts tied to a PowerShell v7 environment? Or is your recommendation to only use Windows PowerShell (< v5.1) for such work? For example the AD module you reference in the article above.
Sure, I’m doing the same, but my question is whether disabling WidnowsCompat and instead using v7 and -UseWindowsPowerShell effectively results in the same result as leaving Windows Compatibility enabled (additional processes, slower performance, etc.).
I would be careful with it. It would have the same effect as the implicit app compat as it will open an external process that will stay open for the duration of the runspace. I’m not sure what would happen if you were to call Remove-Module after using it. It may stop that external process and then at least you could manage the state a lot more closely.
This actually works. It loads the module using WinPS (which starts a powershell.exe process), executes the Get-ScheduledJob command and then you can remove the session at the end and it stops the process.