{"id":8482,"date":"2021-07-13T16:12:57","date_gmt":"2021-07-13T20:12:57","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8482"},"modified":"2021-07-13T16:13:00","modified_gmt":"2021-07-13T20:13:00","slug":"revisiting-powershell-version-inventory","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/","title":{"rendered":"Revisiting PowerShell Version Inventory"},"content":{"rendered":"\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignleft size-large\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"213\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg\" alt=\"https:\/\/www.pexels.com\/photo\/black-binocular-on-round-device-63901\/\" class=\"wp-image-8483\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg 320w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901-300x200.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>In the past, I've shared a variety of PowerShell approaches that you can use to inventory what versions of PowerShell are installed. But I think I now have the best approach short of searching the hard drive for powershell.exe and pwsh.exe, which I suppose is still a possibility and something I should write.<\/p>\n\n\n\n<p>Instead, I'm relying on the fact that if PowerShell or some version of PowerShell 7 was installed, the executable should be found with Get-Command. By the way, the code I came up with is designed to be run on a Windows platform. On non-Windows systems, PowerShell 7 or preview are the only version you can install and those operating systems already have proper tooling for checking installed packages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Get-Command<\/h2>\n\n\n\n<p>In Windows, I can start with Get-Command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$cmd = Get-Command -name powershell.exe -commandtype Application<\/code><\/pre>\n\n\n\n<p>If the file is found, I can run it and extract version information from the host. This will be in addition to version information available from Get-Command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">&amp;$cmd.path -nologo -noprofile -command { Get-Host}<\/code><\/pre>\n\n\n\n<p>With is information I can create a custom object.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0PSTypeName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"PSInstallInfo\"\n\u00a0\u00a0\u00a0\u00a0Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$cmd.Name\n\u00a0\u00a0\u00a0\u00a0FileVersion\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$cmd.Version\n\u00a0\u00a0\u00a0\u00a0PSVersion\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$psh.Version\n\u00a0\u00a0\u00a0\u00a0Comments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$null\n\u00a0\u00a0\u00a0\u00a0Computername\u00a0\u00a0\u00a0\u00a0=\u00a0[System.Environment]::MachineName\n\u00a0\u00a0\u00a0\u00a0OperatingSystem\u00a0=\u00a0$os\n}<\/code><\/pre>\n\n\n\n<p>I'm including the computer name which will be helpful later when I'm querying a bunch of remote machines. I could have used $env:Computername since I expect this will only be used on Windows platforms, but it might not. In which case, I need to use the .NET Framework since $env:Computername isn't available on non-Windows platforms. I'm also grabbing the operating system using Get-CimInstance.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$os\u00a0=\u00a0(Get-CimInstance\u00a0-ClassName\u00a0Win32_OperatingSystem\u00a0-Property\u00a0Caption).caption<\/code><\/pre>\n\n\n\n<p>And you'll also see that I am creating a custom object with a defined typename of 'PSInstalledInfo'.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Inventory Script<\/h2>\n\n\n\n<p>Of course, you want to see the code.<\/p>\n\n\n\n<pre title=\"Get-PSInstalled.ps1\" class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\"><em>#requires\u00a0-version\u00a05.1<\/em>\n\n<em>#Use\u00a0Get-Command\u00a0to\u00a0test\u00a0for\u00a0installed\u00a0versions\u00a0of\u00a0PowerShell<\/em>\n\n[cmdletbinding()]\nParam()\n\nWrite-Verbose\u00a0\"Searching\u00a0for\u00a0PowerShell\u00a0installations\u00a0on\u00a0$([System.Environment]::MachineName)\"\n\n<em>#build\u00a0a\u00a0list\u00a0to\u00a0hold\u00a0the\u00a0results<\/em>\n$list\u00a0=\u00a0[System.Collections.Generic.list[object]]::New()\n\n<em>#get\u00a0the\u00a0operating\u00a0system<\/em>\n$os\u00a0=\u00a0(Get-CimInstance\u00a0-ClassName\u00a0Win32_OperatingSystem\u00a0-Property\u00a0Caption).caption\n\n<em>#Windows\u00a0Powershell<\/em>\nTry\u00a0{\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Testing\u00a0for\u00a0Windows\u00a0PowerShell\"\n\u00a0\u00a0\u00a0\u00a0$cmd\u00a0=\u00a0Get-Command\u00a0-Name\u00a0powershell.exe\u00a0-ErrorAction\u00a0stop\n\u00a0\u00a0\u00a0\u00a0if\u00a0($cmd)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Using\u00a0$($cmd.path)\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$psh\u00a0=\u00a0&amp;$cmd.path\u00a0-nologo\u00a0-noprofile\u00a0-command\u00a0{\u00a0Get-Host\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result\u00a0=\u00a0[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSTypeName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"PSInstallInfo\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$cmd.Name\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0FileVersion\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$cmd.Version\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSVersion\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$psh.Version\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Comments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$null\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Computername\u00a0\u00a0\u00a0\u00a0=\u00a0[System.Environment]::MachineName\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OperatingSystem\u00a0=\u00a0$os\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Remove-Variable\u00a0cmd\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$list.Add($result)\n\u00a0\u00a0\u00a0\u00a0}\n}\nCatch\u00a0{\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Windows\u00a0PowerShell\u00a0not\u00a0installed\u00a0on\u00a0$([Environment]::MachineName).\"\n}\n\n<em>#test\u00a0for\u00a0PowerShell\u00a02.0\u00a0engine\u00a0or\u00a0feature<\/em>\n\nWrite-Verbose\u00a0\"Testing\u00a0for\u00a0Windows\u00a0PowerShell\u00a02.0\u00a0engine\u00a0or\u00a0feature\"\n\nTry\u00a0{\n\u00a0\u00a0\u00a0\u00a0<em>#get\u00a0computersystem\u00a0roles\u00a0to\u00a0determine\u00a0if\u00a0running\u00a0on\u00a0a\u00a0server\u00a0or\u00a0client<\/em>\n\u00a0\u00a0\u00a0\u00a0$cs\u00a0=\u00a0Get-CimInstance\u00a0-ClassName\u00a0win32_Computersystem\u00a0-Property\u00a0Roles\u00a0-ErrorAction\u00a0Stop\n\u00a0\u00a0\u00a0\u00a0$rolestring\u00a0=\u00a0$cs.roles\u00a0-join\u00a0\",\"\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Detected\u00a0roles\u00a0$rolestring\"\n\u00a0\u00a0\u00a0\u00a0if\u00a0($rolestring\u00a0-match\u00a0'Server_NT|Domain_Controller')\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Running\u00a0Get-WindowsFeature\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$f\u00a0=\u00a0Get-WindowsFeature\u00a0PowerShell-V2\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Running\u00a0Get-WindowsOptionalFeature\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$f\u00a0=\u00a0Get-WindowsOptionalFeature\u00a0-Online\u00a0-FeatureName\u00a0MicrosoftWindowsPowerShellV2Root\n\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0if\u00a0($f.installed\u00a0-OR\u00a0$f.State\u00a0-eq\u00a0'Enabled')\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result\u00a0=\u00a0[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSTypeName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"PSInstallInfo\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"powershell.exe\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0FileVersion\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$null\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSVersion\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"2.0\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Comments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"Windows\u00a0PowerShell\u00a02.0\u00a0feature\u00a0enabled\u00a0or\u00a0installed\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Computername\u00a0\u00a0\u00a0\u00a0=\u00a0[System.Environment]::MachineName\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OperatingSystem\u00a0=\u00a0$os\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$list.Add($result)\n\u00a0\u00a0\u00a0\u00a0}\n}\nCatch\u00a0{\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Windows\u00a0PowerShell\u00a02.0\u00a0not\u00a0installed\u00a0on\u00a0$([Environment]::MachineName).\"\n}\n<em>#PowerShell\u00a07<\/em>\n\nWrite-Verbose\u00a0\"Testing\u00a0for\u00a0PowerShell\u00a07\"\n\nTry\u00a0{\n\u00a0\u00a0\u00a0\u00a0$cmd\u00a0=\u00a0Get-Command\u00a0-Name\u00a0\"pwsh.exe\"\u00a0-CommandType\u00a0Application\u00a0-ErrorAction\u00a0Stop\n\n\u00a0\u00a0\u00a0\u00a0if\u00a0($cmd)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach\u00a0($item\u00a0in\u00a0$cmd)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Using\u00a0$($item.path)\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$psh\u00a0=\u00a0&amp;$item.path\u00a0-nologo\u00a0-noprofile\u00a0-command\u00a0{\u00a0Get-Host\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$PSVer\u00a0=\u00a0$psh.version\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<em>#test\u00a0fpr\u00a0SSH<\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Testing\u00a0for\u00a0SSH\u00a0on\u00a0$([Environment]::MachineName)\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$ProgressPreference\u00a0=\u00a0\"SilentlyContinue\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$ssh\u00a0=\u00a0Test-NetConnection\u00a0-ComputerName\u00a0([Environment]::MachineName)\u00a0-Port\u00a022\u00a0-WarningAction\u00a0SilentlyContinue\u00a0-InformationLevel\u00a0Quiet\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0If\u00a0($ssh)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$note\u00a0=\u00a0\"SSH\u00a0detected\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$note\u00a0=\u00a0\"\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result\u00a0=\u00a0[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSTypeName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"PSInstallInfo\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$item.Name\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0FileVersion\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$item.Version\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSVersion\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$PSVer\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Comments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$note.Trim()\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Computername\u00a0\u00a0\u00a0\u00a0=\u00a0[System.Environment]::MachineName\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OperatingSystem\u00a0=\u00a0$os\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$list.Add($result)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#foreach\u00a0item<\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Remove-Variable\u00a0cmd\n\u00a0\u00a0\u00a0\u00a0}\n}\nCatch\u00a0{\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"PowerShell\u00a07\u00a0not\u00a0installed\u00a0on\u00a0$([Environment]::MachineName).\"\n}\n\nWrite-Verbose\u00a0\"Testing\u00a0for\u00a0PowerShell\u00a07\u00a0preview\"\n<em>#filter\u00a0out\u00a0preview\u00a0if\u00a0running\u00a0this\u00a0command\u00a0IN\u00a0a\u00a0preview<\/em>\nif\u00a0($host.version.PSSemVerPreReleaseLabel)\u00a0{\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"PowerShell\u00a0preview\u00a0detected\"\n\u00a0\u00a0\u00a0\u00a0$n\u00a0=\u00a0\"pwsh.exe\"\n}\nelse\u00a0{\n\u00a0\u00a0\u00a0\u00a0$n\u00a0=\u00a0\"pwsh-preview.cmd\"\n}\nTry\u00a0{\n\u00a0\u00a0\u00a0\u00a0$cmd\u00a0=\u00a0Get-Command\u00a0-Name\u00a0$n\u00a0-CommandType\u00a0Application\u00a0-ErrorAction\u00a0Stop\n\n\u00a0\u00a0\u00a0\u00a0if\u00a0($cmd)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach\u00a0($item\u00a0in\u00a0$cmd)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Using\u00a0$($item.path)\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$psh\u00a0=\u00a0&amp;$item.path\u00a0-nologo\u00a0-noprofile\u00a0-command\u00a0{\u00a0Get-Host\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$PSVer\u00a0=\u00a0$psh.version\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($psver.PSSemVerPreReleaseLabel)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[string]$note\u00a0=\u00a0$psver.PSSemVerPreReleaseLabel\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[string]$note\u00a0=\u00a0\"\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<em>#test\u00a0fpr\u00a0SSH<\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Testing\u00a0for\u00a0SSH\u00a0on\u00a0$([Environment]::MachineName).\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$ProgressPreference\u00a0=\u00a0\"SilentlyContinue\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$ssh\u00a0=\u00a0Test-NetConnection\u00a0-ComputerName\u00a0([Environment]::MachineName)\u00a0-Port\u00a022\u00a0-WarningAction\u00a0SilentlyContinue\u00a0-InformationLevel\u00a0Quiet\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($ssh)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$note\u00a0+=\u00a0\"\u00a0SSH\u00a0detected\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$result\u00a0=\u00a0[pscustomobject]@{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSTypeName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0\"PSInstallInfo\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$item.Name\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0FileVersion\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$item.Version\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0PSVersion\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$PSVer\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Comments\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0=\u00a0$note.Trim()\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Computername\u00a0\u00a0\u00a0\u00a0=\u00a0[System.Environment]::MachineName\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OperatingSystem\u00a0=\u00a0$os\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0($list.Psversion\u00a0-notcontains\u00a0$result.PSVersion)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$list.Add($result)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"Skipping\u00a0duplicate\u00a0version\u00a0$($result.version)\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\u00a0<em>#foreach\u00a0item<\/em>\n\u00a0\u00a0\u00a0\u00a0}\n}\nCatch\u00a0{\n\u00a0\u00a0\u00a0\u00a0Write-Verbose\u00a0\"PowerShell\u00a07\u00a0preview\u00a0not\u00a0installed\u00a0on\u00a0$([Environment]::MachineName).\"\n}\n\n<em>#write\u00a0the\u00a0results\u00a0to\u00a0the\u00a0pipeline<\/em>\n$list\u00a0|\u00a0Sort-Object\u00a0-Property\u00a0PSVersion<\/code><\/pre>\n\n\n\n<p>As you look through the code I'm searching for PowerShell and pwsh versions. I'm also testing if ssh is enabled on systems running PowerShell 7. I didn't want to rely on checking the sshd service because I didn't want to make an assumption. Although I am assuming port 22. You'll also see that I am specifying a computername for Test-NetConnection. In my testing, if I don't specify a computername, PowerShell tries to connect to a public IP address.<\/p>\n\n\n\n<p>Here's how it looks on my local machine.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"592\" height=\"535\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-1.png\" alt=\"\" class=\"wp-image-8486\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-1.png 592w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-1-300x271.png 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/a><\/figure>\n\n\n\n<p>Because this is a script, I can use it with Invoke-Command to query remote Windows computers, assuming of course that PowerShell remoting is enabled.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"154\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2-1024x154.png\" alt=\"\" class=\"wp-image-8487\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2-1024x154.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2-300x45.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2-768x115.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2-850x128.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-2.png 1046w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Doing More with Type<\/h2>\n\n\n\n<p>Of course, since I have a custom object, I can do more. Such as define a setup of default properties.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Update-TypeData\u00a0-TypeName\u00a0PSInstallInfo\u00a0-DefaultDisplayPropertySet\u00a0\"Name\",\"FileVersion\",\"PSVersion\",\"Comments\",\"ComputerName\"\u00a0-force<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"274\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-3.png\" alt=\"\" class=\"wp-image-8489\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-3.png 880w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-3-300x93.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-3-768x239.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-3-850x265.png 850w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/a><\/figure>\n\n\n\n<p>This gets rid of the pesky RunspaceID property you get when using Invoke-Command. <\/p>\n\n\n\n<p>Or, I can really get going and define a custom format file which I did using my trusty <a href=\"http:\/\/bit.ly\/31SGo5o\" target=\"_blank\" rel=\"noreferrer noopener\">New-PSFormatXML<\/a> command.<\/p>\n\n\n\n<pre title=\"PSInstalledInfo.format.ps1xml\" class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml\"><em>&lt;!--<\/em>\n<em>Format\u00a0type\u00a0data\u00a0generated\u00a007\/13\/2021\u00a012:14:45\u00a0by\u00a0PROSPERO\\Jeff<\/em>\n\n<em>This\u00a0file\u00a0was\u00a0created\u00a0using\u00a0the\u00a0New-PSFormatXML\u00a0command\u00a0that\u00a0is\u00a0part<\/em>\n<em>of\u00a0the\u00a0PSScriptTools\u00a0module.<\/em>\n\n<em>https:\/\/github.com\/jdhitsolutions\/PSScriptTools<\/em>\n<em>--><\/em>\n&lt;Configuration>\n\u00a0\u00a0&lt;ViewDefinitions>\n\u00a0\u00a0\u00a0\u00a0&lt;View>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<em>&lt;!--Created\u00a007\/13\/2021\u00a012:14:45\u00a0by\u00a0PROSPERO\\Jeff--><\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Name>default&lt;\/Name>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;ViewSelectedBy>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TypeName>PSInstallInfo&lt;\/TypeName>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/ViewSelectedBy>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;GroupBy>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;ScriptBlock>\"{0}\u00a0[{1}]\"\u00a0-f\u00a0$_.Computername,$_.OperatingSystem&lt;\/ScriptBlock>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Label>Computername&lt;\/Label>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/GroupBy>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableControl>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<em>&lt;!--Delete\u00a0the\u00a0AutoSize\u00a0node\u00a0if\u00a0you\u00a0want\u00a0to\u00a0use\u00a0the\u00a0defined\u00a0widths<\/em>\n<em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;AutoSize\u00a0\/>.--><\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableHeaders>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Label>Name&lt;\/Label>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Width>19&lt;\/Width>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Alignment>left&lt;\/Alignment>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Label>FileVersion&lt;\/Label>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Width>15&lt;\/Width>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Alignment>left&lt;\/Alignment>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Label>PSVersion&lt;\/Label>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Width>15&lt;\/Width>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Alignment>left&lt;\/Alignment>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Label>Comments&lt;\/Label>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnHeader>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableHeaders>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableRowEntries>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableRowEntry>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnItems>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;PropertyName>Name&lt;\/PropertyName>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;PropertyName>FileVersion&lt;\/PropertyName>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;ScriptBlock>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0(($host.name\u00a0-match\u00a0\"console|code|serverremotehost\")\u00a0-AND\u00a0($_.name\u00a0-match\u00a0\"preview\"))\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"$([char]27)[38;5;219m$($_.PSVersion)$([char]27)[0m\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$_.PSVersion\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/ScriptBlock>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;ScriptBlock>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if\u00a0(($host.name\u00a0-match\u00a0\"console|code|serverremotehost\")\u00a0-AND\u00a0($_.comments-match\u00a0\"SSH\u00a0detected\"))\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<em>&lt;!--\u00a0replace\u00a0SSH\u00a0Detected\u00a0with\u00a0an\u00a0ANSI\u00a0sequence--><\/em>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$_.comments\u00a0-replace\u00a0\"SSH\u00a0detected\",\"$([char]27)[1;38;5;155mSSH\u00a0detected$([char]27)[0m\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$_.comments\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/ScriptBlock>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnItem>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableColumnItems>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableRowEntry>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableRowEntries>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/TableControl>\n\u00a0\u00a0\u00a0\u00a0&lt;\/View>\n\u00a0\u00a0&lt;\/ViewDefinitions>\n&lt;\/Configuration><\/code><\/pre>\n\n\n\n<p>I'm using ANSI sequences to highlight PowerShell previews and SSH. All I need to do is import it into my session.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Update-Formatdata c:\\scripts\\psinstalledinfo.format.ps1xml<\/code><\/pre>\n\n\n\n<p>Now, I get very meaningful output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"556\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-4.png\" alt=\"\" class=\"wp-image-8490\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-4.png 1023w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-4-300x163.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-4-768x417.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/get-psinstalled-4-850x462.png 850w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Your Turn<\/h2>\n\n\n\n<p>I hope you'll give this a try. There's certainly room for you to add your own touches. I left the Comments property mostly unused for future use. Or you may want to grab additional information like file timestamps. Have fun.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the past, I&#8217;ve shared a variety of PowerShell approaches that you can use to inventory what versions of PowerShell are installed. But I think I now have the best approach short of searching the hard drive for powershell.exe and pwsh.exe, which I suppose is still a possibility and something I should write. Instead, I&#8217;m&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"New on the blog: Revisiting #PowerShell Version Inventory","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,610,8],"tags":[350,534,611,140,540],"class_list":["post-8482","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-7","category-scripting","tag-format","tag-powershell","tag-powershell-7","tag-ps1xml","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Revisiting PowerShell Version Inventory &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"My latest PowerShell script to inventory installed versions of Windows PowerShell and PowerShell 7, including preview builds and SSH status.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Revisiting PowerShell Version Inventory &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"My latest PowerShell script to inventory installed versions of Windows PowerShell and PowerShell 7, including preview builds and SSH status.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-13T20:12:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-13T20:13:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Revisiting PowerShell Version Inventory\",\"datePublished\":\"2021-07-13T20:12:57+00:00\",\"dateModified\":\"2021-07-13T20:13:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/\"},\"wordCount\":514,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/pexels-skitterphoto-63901.jpg\",\"keywords\":[\"Format\",\"PowerShell\",\"PowerShell 7\",\"ps1xml\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"PowerShell 7\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/\",\"name\":\"Revisiting PowerShell Version Inventory &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/pexels-skitterphoto-63901.jpg\",\"datePublished\":\"2021-07-13T20:12:57+00:00\",\"dateModified\":\"2021-07-13T20:13:00+00:00\",\"description\":\"My latest PowerShell script to inventory installed versions of Windows PowerShell and PowerShell 7, including preview builds and SSH status.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/pexels-skitterphoto-63901.jpg\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/pexels-skitterphoto-63901.jpg\",\"width\":320,\"height\":213,\"caption\":\"binoculars\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8482\\\/revisiting-powershell-version-inventory\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Revisiting PowerShell Version Inventory\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Revisiting PowerShell Version Inventory &#8226; The Lonely Administrator","description":"My latest PowerShell script to inventory installed versions of Windows PowerShell and PowerShell 7, including preview builds and SSH status.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/","og_locale":"en_US","og_type":"article","og_title":"Revisiting PowerShell Version Inventory &#8226; The Lonely Administrator","og_description":"My latest PowerShell script to inventory installed versions of Windows PowerShell and PowerShell 7, including preview builds and SSH status.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-07-13T20:12:57+00:00","article_modified_time":"2021-07-13T20:13:00+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Revisiting PowerShell Version Inventory","datePublished":"2021-07-13T20:12:57+00:00","dateModified":"2021-07-13T20:13:00+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/"},"wordCount":514,"commentCount":4,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg","keywords":["Format","PowerShell","PowerShell 7","ps1xml","Scripting"],"articleSection":["PowerShell","PowerShell 7","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/","name":"Revisiting PowerShell Version Inventory &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg","datePublished":"2021-07-13T20:12:57+00:00","dateModified":"2021-07-13T20:13:00+00:00","description":"My latest PowerShell script to inventory installed versions of Windows PowerShell and PowerShell 7, including preview builds and SSH status.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/pexels-skitterphoto-63901.jpg","width":320,"height":213,"caption":"binoculars"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8482\/revisiting-powershell-version-inventory\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Revisiting PowerShell Version Inventory"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":101,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/101\/updated-powershell-help-utility\/","url_meta":{"origin":8482,"position":0},"title":"Updated PowerShell Help Utility","author":"Jeffery Hicks","date":"February 19, 2007","format":false,"excerpt":"SAPIEN Technologies has released a new version of their free PowerShellHelp tool. This tool gets all the help information from your PowerShell installation and presents it in a nice GUI that now looks like Office 2007. The screen shot doesn't really do it justice, but you get the idea.Not only\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3019,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/","url_meta":{"origin":8482,"position":1},"title":"PowerShell Scripting Games 2013 Impressions","author":"Jeffery Hicks","date":"May 13, 2013","format":false,"excerpt":"Now that the PowerShell Scripting Games for 2013 are well underway, I thought I'd share my thoughts and impressions on what I've seen. I'm very impressed with the number of entries and generally the quality is pretty good. But as a judge I see repeated items that bear comment. These\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/scriptinggames.org\/games-logo.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":35,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/35\/printing-from-powershell\/","url_meta":{"origin":8482,"position":2},"title":"Printing from PowerShell","author":"Jeffery Hicks","date":"June 6, 2006","format":false,"excerpt":"PowerShell has a slick feature that allows you to send the output from a cmdlet or expression directly to a printer. Pipe the output to the Out-Printer cmdlet and it will print out on the default printer:get-process | out-printer If you have other printers installed you can use the printer\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":39,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/39\/free-powershell-help-viewer\/","url_meta":{"origin":8482,"position":3},"title":"Free PowerShell Help Viewer","author":"Jeffery Hicks","date":"July 25, 2006","format":false,"excerpt":"The terrific people at SAPIEN have released a free PowerShell Help viewer. You obviously need the latest PowerShell release installed. If so, go to http:\/\/www.sapienpress.com\/powershell.asp and grab the download. The tool will list all aliases, cmdlet help and the little \"about\" help files.If you're like me you realize you want\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8027,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8027\/powershell-modules-in-a-cross-version-world\/","url_meta":{"origin":8482,"position":4},"title":"PowerShell Modules in a Cross-Version World","author":"Jeffery Hicks","date":"January 14, 2021","format":false,"excerpt":"The other day I was helping a friend sort out some module-related questions. While helping him, I realized his questions and problems were not unique. Now that many of us are running Windows PowerShell 7 side-by-side, what are the implications when it comes to using PowerShell modules? What are the\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/01\/module-locations.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":8787,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8787\/prerelease-of-psfunctiontools-for-powershell\/","url_meta":{"origin":8482,"position":5},"title":"Prerelease of PSFunctionTools for PowerShell","author":"Jeffery Hicks","date":"January 13, 2022","format":false,"excerpt":"At the end of last year wrote a series of blog posts describing tools and techniques for working with PowerShell scripts and functions. My goal was to build a framework of tools that I could use to automate PowerShell scripting work, such as creating a new module from a group\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=8482"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8482\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}