Kaseya Community

Detection Logic for PowerShell

  • Good post about how to programmatically detect the installation of PowerShell. We have been using this and can confirm that checking for this registry key in KScripts that call PoSH scripts works well.



    Legacy Forum Name: Detection Logic for PowerShell,
    Legacy Posted By Username: RCS-Michael
  • This can be useful, so I went ahead and scripted it for anyone who wants it... you can build on this to deploy PowerShell, or whatever else you want to do

    Script Name: Detect if PowerShell is installed
    Script Description: Detect if PowerShell is installed

    IF Check Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\Install
    Exists :
    Get Variable
    Parameter 1 : 0
    Parameter 2 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine\PowerShellVersion
    Parameter 3 : PowerShellVer
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : PowerShell version #PowerShellVer# is installed
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : PowerShell is not installed
    OS Type : 0

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: dbennett