Multiple line or array to one line (Example: Windows Version)
Aus Wiki-WebPerfect
Version vom 6. April 2018, 12:09 Uhr von Admin (Diskussion | Beiträge)
Multiple line/array to one line
Multiple line/array
CurrentMajorVersionNumber","CurrentMinorVersionNumber","CurrentBuildNumber","ReleaseId","UBR" | foreach {(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").$_}
Output
10 0 14393 1607 2156
Format Multiple line/array to one line (with "." between each number) - Display Windows Version (incl. Patchlevel)
("CurrentMajorVersionNumber","CurrentMinorVersionNumber","CurrentBuildNumber","ReleaseId","UBR" | foreach {(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").$_}) -join "."
Output
10.0.14393.1607.2156