1

With Windows Powershell it is possible to lookup the installed version within the registry.

Using C#, what is the most reliable way to determine if Powershell Core (6+) is available on a system, as well as what version?

Note: I appreciate it can be deployed via zip which complicates this, so specifically looking for "installed" instances.

Brett Postin
  • 11,215
  • 10
  • 60
  • 95

1 Answers1

0

Here is a similar question to yours: Get installed applications in a system. It talks more generally about getting installed applications with C#, but you should be able to adapt it to fit your needs.

Powershell Core v6+ & v7+ show up in the installed programs list separately unlike the Powershell install embedded in Windows.

catherinemohan
  • 361
  • 1
  • 7