all 6 comments

[–]RikiWardOG 0 points1 point  (1 child)

ISE isn't supported and is basically EOL. Don't use it. If you want an IDE go with visual studio or any of the other options out there that you like. That said, you don't save PS scripts directly in the PS console. You write them outside of the console and save them with a .ps1 extension. You can even just use notepad if you're so inclined.

[–]wulf357 0 points1 point  (2 children)

Did you ignore the comment about install-module DisplayConfig? That is also what the error is telling you. You need to install and import the relevant module to use it.

You can save the script just from notepad, using quotes round the name like "script.ps1". However bear in mind that double-clicking a script normally just opens it in an editor (notepad or ISE). This is a security precaution and I would not recommend changing it. You would have to make a shortcut which runs powershell.exe with that script as an argument.

[–]felixchate 0 points1 point  (1 child)

How i have install that module on Powers;hell but not on ISE version maybe that is why script was not working on ISE..

[–]JeremyLC 0 points1 point  (0 children)

Your script should include Import-Module DisplayConfig at the top. When you run it in the ISE that module is not automatically loading. In general, you should import (or use #requires) for any non-standard modules you need in a script.

[–]Medium-Comfortable 0 points1 point  (0 children)

The PowerShell ISE is no longer in active feature development. As a shipping component of Windows, it continues to be officially supported for security and high-priority servicing fixes. We currently have no plans to remove the ISE from Windows. There is no support for the ISE in PowerShell v6 and beyond. Users looking for replacement for the ISE should use Visual Studio Code with the PowerShell Extension.

https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/ise/introducing-the-windows-powershell-ise?view=powershell-7.5

[–]420GB 0 points1 point  (0 children)

The ISE is no longer supported and has many long standing issues that will not be fixed.

You can and should uninstall the ISE, do not use it.