PowerShell_PC_Aide

Environment class (OS, ).ps1

Sep 14th, 2019
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. --------------------------------------------------------------------------------------------
  3. System.Environment Class
  4.  
  5.     [Environment]::<OSVersion, MachineName, HasShutdownStarted, NewLine, ...
  6.                  ::<SystemDirectory,
  7. --------------------------------------------------------------------------------------------
  8. #>
  9.  
  10. #OS Version + Build + Revision <- https://imgur.com/oG4A5Zu
  11. [Environment]::OSVersion.Version
  12.  
  13. #System Directory (default C:\Windows\System32)
  14. [Environment]::SystemDirectory
  15.  
  16. #Major + Minor + Build + Revision <- https://imgur.com/Qt0WkdJ
  17. $OSVersion = [Version](Get-ItemProperty -Path "$($Env:Windir)\System32\hal.dll" -ErrorAction SilentlyContinue).VersionInfo.FileVersion.Split()[0]
Advertisement
Add Comment
Please, Sign In to add comment