osInfo() add domain (windows)
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Test / build (16.x, macos-latest) (push) Waiting to run
Test / build (16.x, ubuntu-latest) (push) Waiting to run
Test / build (16.x, windows-latest) (push) Waiting to run
Test / build (17.x, ubuntu-latest) (push) Waiting to run
Test / build (18.x, macos-latest) (push) Waiting to run
Test / build (18.x, ubuntu-latest) (push) Waiting to run
Test / build (18.x, windows-latest) (push) Waiting to run
Test / build (19.x, ubuntu-latest) (push) Waiting to run
Test / build (20.x, macos-latest) (push) Waiting to run
Test / build (20.x, ubuntu-latest) (push) Waiting to run
Test / build (20.x, windows-latest) (push) Waiting to run
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Test / build (16.x, macos-latest) (push) Waiting to run
Test / build (16.x, ubuntu-latest) (push) Waiting to run
Test / build (16.x, windows-latest) (push) Waiting to run
Test / build (17.x, ubuntu-latest) (push) Waiting to run
Test / build (18.x, macos-latest) (push) Waiting to run
Test / build (18.x, ubuntu-latest) (push) Waiting to run
Test / build (18.x, windows-latest) (push) Waiting to run
Test / build (19.x, ubuntu-latest) (push) Waiting to run
Test / build (20.x, macos-latest) (push) Waiting to run
Test / build (20.x, ubuntu-latest) (push) Waiting to run
Test / build (20.x, windows-latest) (push) Waiting to run
This commit is contained in:
parent
91e1acf7d3
commit
504ecf272d
@ -228,6 +228,7 @@ function osInfo(callback) {
|
||||
distro: 'unknown',
|
||||
release: 'unknown',
|
||||
codename: '',
|
||||
domain: '',
|
||||
kernel: os.release(),
|
||||
arch: os.arch(),
|
||||
hostname: os.hostname(),
|
||||
@ -364,6 +365,7 @@ function osInfo(callback) {
|
||||
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
||||
workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));
|
||||
workload.push(util.powerShell('reg query "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /v DisplayVersion'));
|
||||
workload.push(util.powerShell('Get-CimInstance Win32_ComputerSystem | select Domain | fl '));
|
||||
util.promiseAll(workload).then((data) => {
|
||||
const lines = data.results[0] ? data.results[0].toString().split('\r\n') : [''];
|
||||
result.distro = util.getValue(lines, 'Caption', ':').trim();
|
||||
@ -378,6 +380,8 @@ function osInfo(callback) {
|
||||
const codenameParts = data.results[3].split('REG_SZ');
|
||||
result.codename = codenameParts.length > 1 ? codenameParts[1].trim() : '';
|
||||
}
|
||||
const domain = data.results[4] ? data.results[4].toString().split('\r\n') : [''];
|
||||
result.domain = util.getValue(domain, 'Domain', ':').trim();
|
||||
if (!result.codename) {
|
||||
const buildNum = parseInt(result.build, 10);
|
||||
result.codename = getWindowsRelease(buildNum);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user