Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Get Battery
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; if ((Get-WmiObject win32_Battery).BatteryStatus -eq '2'){$IsAC='TRUE'}; $tsenv.Value('IsAC') = $IsAC }"
- #Get Model
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; if ((Get-WmiObject win32_ComputerSystem).Manufacturer -eq 'Lenovo'){$Model=(Get-WmiObject win32_ComputerSystemProduct).Version} Else {$Model=(Get-WmiObject win32_ComputerSystem).Model}; $tsenv.Value('Model') = $Model }"
- #Get UEFI
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; if ((Get-WmiObject Win32_DiskPartition).type -eq 'GPT: System'){$IsUEFI='TRUE'}; $tsenv.Value('IsUEFI') = $IsUEFI }"
- #Get Version
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; if ((Get-WmiObject Win32_OperatingSystem).Version -eq '10.0.17134'){$OSVer='FALSE'} Else {$OSVer = 'TRUE'}; $tsenv.Value('OSVer') = $OSVer }"
- #Get Total RAM
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; ; if ((Get-wmiobject Win32_PhysicalMemory | Measure-Object -Property capacity -Sum).sum/1gb -ge '2'){$TotalRam='TRUE'}; $tsenv.Value('TotalRam') = $TotalRam }"
- #Get Free Diskspace
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; if ((Get-PSDrive C).free/1gb -ge '30'){$FreeSpace='TRUE'};$tsenv.Value('FreeSpace') = $FreeSpace }"
- #Get LAN
- powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; $NetAdapter= Get-NetAdapter |Where-Object {$_.PhysicalMediaType -eq '802.3'}; If ($NetAdapter.Status -eq 'Up') {$IsLan='TRUE'};$tsenv.Value('IsLan') = $IsLan }"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement