![]() ![]() ![]() Starting with version 5.1, PowerShell Core is bundled with Windows Server. I am completely unable to get any of the modifications to actually work. PowerShell is a task automation and configuration management program from Microsoft. I have pored through the registry and the file system, and I can find no perfect method for collecting the installed Office version. Or in the case of trying to run the script by typing “scriptname.ps1” returns with the term is not recognized as the name of a cmdlet, function, script file, or operable program. Programmatically, what method can get the name of the installed Microsoft Office versionI have tried every Powershell command, VBScript, and WMI query I could find. Are lines being added? Is the script being run in the ISE version or just straight powershell? Does it matter? If lines are being added, where? The solutions for modifying the script above might work wonderfully for those who know how to integrate them, but following *any* of them at face value consistently produces error messages that indicate that the term used is not recognized. I’m going to go ahead and put my ignorance on full display here, but since I am only barely familiar with Powershell, I absolutely cannot fill in the blanks between the script as originally written and the modifications offered or changing the way the script is initiated. $Result = Invoke-Command –ComputerName $Computer –ScriptBlock $Code –ErrorAction Stop $Result = Invoke-Command –ScriptBlock $Code Rows.Add( $ env:COMPUTERNAME, $ProductName, $Version, $OSVersion) Columns.AddRange( "ComputerName ", "Windows Edition ", "Version ", "OS Build ")) $UBR = ( Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion ' –Name UBR).UBR ![]() $CurrentBuild = ( Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion ' –Name CurrentBuild).CurrentBuild For example, PS C:\> System.Environment::OSVersion. For the version number, there is the Version property. NET library, you could access the OSVersion property of the System.Environment class to get this information. $Version = ( Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion ' –Name ReleaseID –ErrorAction Stop).ReleaseID 1 2 Next 238 Since you have access to the. $ProductName = ( Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion ' –Name ProductName).ProductName ValueFromPipelineByPropertyName = $true , So I put together a PowerShell script that can be used to get the Windows version for a local or remote computer (or group of computers) which includes the Edition, Version and full OS Build values. To find the full number I have to query the registry in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion branch. If I run the usual WMI query to get the build number I just get 15063: Open Settings > System > About on a Windows 10 box, and you’ll find the OS Build value, in my case 15063.183 In Windows 10 at least, the full build number containing the “UBR”, or essentially the CU patch level of the build, is a useful piece of information. Much to my surprise I discovered that the full build number for a Windows OS is not stored in WMI in the usual Win32_OperatingSystem class. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |