@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
59 lines (57 loc) • 25.4 kB
JavaScript
/* eslint:disable */
/**
* @file Source code generated by gulp-ps-code.
* @version 1.1
*/
export var PowerShellScripts;
(function (PowerShellScripts) {
'use strict';
PowerShellScripts.module = 'Microsoft.SME.Shell';
PowerShellScripts.resourceName = 'MsftSmeShell';
PowerShellScripts.powerShellPrefix = 'WACSH';
PowerShellScripts.Start_ScheduledReboot = {
command: 'Start-ScheduledReboot',
script: "##Start-ScheduledReboot##:Start-ScheduledReboot.ps1\nparam (\n[Parameter(Mandatory = $true)]\n[bool]$restartlater,\n[Parameter(Mandatory = $false)]\n[String]$restartTime,\n[Parameter(Mandatory = $false)]\n[String]$restartReason,\n[Parameter(Mandatory = $false)]\n[System.Int16]$reasonNumberMajor,\n[Parameter(Mandatory = $false)]\n[System.Int16]$reasonNumberMinor\n)\n$waitTime = 5\nif ($restartlater -and -not($restartTime)) {\n$waitTime = 30\n} elseif ($restartTime) {\n$waitTime = [decimal]::round(((Get-Date $restartTime) - (Get-Date)).TotalSeconds);\nif ($waitTime -gt (315360000 - 30)) {\nTHROW \"Invalid restart time $restartTime. The valid range is 0-315360000s (10 years), with a default of 30\"\n}\n}\nif ($waitTime -lt 5 ) {\n$waitTime = 5\n}\n$command = \"Shutdown /r /t $waitTime\"\nif ($restartReason -and ($reasonNumberMajor -ne $null) -and ($reasonNumberMinor -ne $null)) {\n$command += \" /d ${restartReason}:${reasonNumberMajor}:${reasonNumberMinor}\"\n}\nInvoke-Expression -Command $command\n"
};
PowerShellScripts.Stop_Reboot = {
command: 'Stop-Reboot',
script: "##Stop-Reboot##:Stop-Reboot.ps1\n$command = \"Shutdown /a\"\nInvoke-Expression -Command $command\n"
};
PowerShellScripts.Get_DecryptedDataFromNode = {
command: 'Get-DecryptedDataFromNode',
script: "##Get-DecryptedDataFromNode##:Get-DecryptedDataFromNode.ps1\nparam (\n[Parameter(Mandatory = $true)]\n[String]\n$encryptedData\n)\nSet-StrictMode -Version 5.0\nNew-Variable -Name rsaProviderInstanceName -Value \"RSA\" -Option Constant\nfunction DecryptDataWithJWKOnNode {\nif(Get-Variable -Scope Global -Name $rsaProviderInstanceName -EA SilentlyContinue) {\n$rsaProvider = (Get-Variable -Scope Global -Name $rsaProviderInstanceName).Value\n$decryptedBytes = $rsaProvider.Decrypt([Convert]::FromBase64String($encryptedData), [System.Security.Cryptography.RSAEncryptionPadding]::OaepSHA1)\nreturn [System.Text.Encoding]::UTF8.GetString($decryptedBytes)\n}\nthrow [System.InvalidOperationException] \"Password decryption failed. RSACryptoServiceProvider Instance not found\"\n}\n"
};
PowerShellScripts.Get_EncryptionJWKOnNode = {
command: 'Get-EncryptionJWKOnNode',
script: "##Get-EncryptionJWKOnNode##:Get-EncryptionJWKOnNode.ps1\nSet-StrictMode -Version 5.0\nNew-Variable -Name rsaProviderInstanceName -Value \"RSA\" -Option Constant\nfunction Get-RSAProvider\n{\nif(Get-Variable -Scope Global -Name $rsaProviderInstanceName -EA SilentlyContinue)\n{\nreturn (Get-Variable -Scope Global -Name $rsaProviderInstanceName).Value\n}\n$Global:RSA = New-Object System.Security.Cryptography.RSACryptoServiceProvider -ArgumentList 4096\nreturn $RSA\n}\nfunction Get-JsonWebKey\n{\n$rsaProvider = Get-RSAProvider\n$parameters = $rsaProvider.ExportParameters($false)\nreturn [PSCustomObject]@{\nkty = \u0027RSA\u0027\nalg = \u0027RSA-OAEP\u0027\ne = [Convert]::ToBase64String($parameters.Exponent)\nn = [Convert]::ToBase64String($parameters.Modulus).TrimEnd(\u0027=\u0027).Replace(\u0027+\u0027, \u0027-\u0027).Replace(\u0027/\u0027, \u0027_\u0027)\n}\n}\n$jwk = Get-JsonWebKey\nConvertTo-Json $jwk -Compress\n"
};
PowerShellScripts.Get_CimWin32LogicalDisk = {
command: 'Get-CimWin32LogicalDisk',
script: "##Get-CimWin32LogicalDisk##:Get-CimWin32LogicalDisk.ps1\nimport-module CimCmdlets\nGet-CimInstance -Namespace root/cimv2 -ClassName Win32_LogicalDisk\n"
};
PowerShellScripts.Get_CimWin32NetworkAdapter = {
command: 'Get-CimWin32NetworkAdapter',
script: "##Get-CimWin32NetworkAdapter##:Get-CimWin32NetworkAdapter.ps1\nimport-module CimCmdlets\nGet-CimInstance -Namespace root/cimv2 -ClassName Win32_NetworkAdapter\n"
};
PowerShellScripts.Get_CimWin32PhysicalMemory = {
command: 'Get-CimWin32PhysicalMemory',
script: "##Get-CimWin32PhysicalMemory##:Get-CimWin32PhysicalMemory.ps1\nimport-module CimCmdlets\nGet-CimInstance -Namespace root/cimv2 -ClassName Win32_PhysicalMemory\n"
};
PowerShellScripts.Get_CimWin32Processor = {
command: 'Get-CimWin32Processor',
script: "##Get-CimWin32Processor##:Get-CimWin32Processor.ps1\nimport-module CimCmdlets\nGet-CimInstance -Namespace root/cimv2 -ClassName Win32_Processor\n"
};
PowerShellScripts.Get_ClusterInventory = {
command: 'Get-ClusterInventory',
script: "##Get-ClusterInventory##:Get-ClusterInventory.ps1\nImport-Module CimCmdlets -ErrorAction SilentlyContinue\nImport-Module FailoverClusters -ErrorAction SilentlyContinue\nImport-Module Storage -ErrorAction SilentlyContinue\nfunction getComputerName() {\n$computerSystem = Get-CimInstance Win32_ComputerSystem -ErrorAction SilentlyContinue | Microsoft.PowerShell.Utility\\Select-Object Name, DNSHostName\nif ($computerSystem) {\n$computerName = $computerSystem.DNSHostName\nif ($null -eq $computerName) {\n$computerName = $computerSystem.Name\n}\nreturn $computerName\n}\nreturn $null\n}\nfunction getIsClusterCmdletAvailable() {\n$cmdlet = Get-Command \"Get-Cluster\" -ErrorAction SilentlyContinue\nreturn !!$cmdlet\n}\nfunction getClusterCimInstance() {\n$namespace = Get-CimInstance -Namespace root/MSCluster -ClassName __NAMESPACE -ErrorAction SilentlyContinue\nif ($namespace) {\nreturn Get-CimInstance -Namespace root/mscluster MSCluster_Cluster -ErrorAction SilentlyContinue | Microsoft.PowerShell.Utility\\Select-Object fqdn, S2DEnabled\n}\nreturn $null\n}\nfunction getClusterPerformanceHistoryPath() {\n$storageSubsystem = Get-StorageSubSystem clus* -ErrorAction SilentlyContinue\n$storageHealthSettings = Get-StorageHealthSetting -InputObject $storageSubsystem -Name \"System.PerformanceHistory.Path\" -ErrorAction SilentlyContinue\nreturn $null -ne $storageHealthSettings\n}\nfunction getClusterInfo() {\n$returnValues = @{}\n$returnValues.Fqdn = $null\n$returnValues.isS2DEnabled = $false\n$returnValues.isTsdbEnabled = $false\n$cluster = getClusterCimInstance\nif ($cluster) {\n$returnValues.Fqdn = $cluster.fqdn\n$isS2dEnabled = !!(Get-Member -InputObject $cluster -Name \"S2DEnabled\") -and ($cluster.S2DEnabled -eq 1)\n$returnValues.isS2DEnabled = $isS2dEnabled\nif ($isS2DEnabled) {\n$returnValues.isTsdbEnabled = getClusterPerformanceHistoryPath\n} else {\n$returnValues.isTsdbEnabled = $false\n}\n}\nreturn $returnValues\n}\nfunction getisClusterHealthCmdletAvailable() {\n$cmdlet = Get-Command -Name \"Get-HealthFault\" -ErrorAction SilentlyContinue\nreturn !!$cmdlet\n}\nfunction getIsBritannicaEnabled() {\nreturn $null -ne (Get-CimInstance -Namespace root/sddc/management -ClassName SDDC_Cluster -ErrorAction SilentlyContinue)\n}\nfunction getIsBritannicaVirtualMachineEnabled() {\nreturn $null -ne (Get-CimInstance -Namespace root/sddc/management -ClassName SDDC_VirtualMachine -ErrorAction SilentlyContinue)\n}\nfunction getIsBritannicaVirtualSwitchEnabled() {\nreturn $null -ne (Get-CimInstance -Namespace root/sddc/management -ClassName SDDC_VirtualSwitch -ErrorAction SilentlyContinue)\n}\n$clusterInfo = getClusterInfo\n$result = New-Object PSObject\n$result | Add-Member -MemberType NoteProperty -Name \u0027Fqdn\u0027 -Value $clusterInfo.Fqdn\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsS2DEnabled\u0027 -Value $clusterInfo.isS2DEnabled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsTsdbEnabled\u0027 -Value $clusterInfo.isTsdbEnabled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsClusterHealthCmdletAvailable\u0027 -Value (getIsClusterHealthCmdletAvailable)\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsBritannicaEnabled\u0027 -Value (getIsBritannicaEnabled)\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsBritannicaVirtualMachineEnabled\u0027 -Value (getIsBritannicaVirtualMachineEnabled)\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsBritannicaVirtualSwitchEnabled\u0027 -Value (getIsBritannicaVirtualSwitchEnabled)\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsClusterCmdletAvailable\u0027 -Value (getIsClusterCmdletAvailable)\n$result | Add-Member -MemberType NoteProperty -Name \u0027CurrentClusterNode\u0027 -Value (getComputerName)\n$result\n"
};
PowerShellScripts.Get_ClusterNodes = {
command: 'Get-ClusterNodes',
script: "##Get-ClusterNodes##:Get-ClusterNodes.ps1\nimport-module CimCmdlets\nimport-module FailoverClusters -ErrorAction SilentlyContinue\nSet-Variable -Name LogName -Option Constant -Value \"Microsoft-ServerManagementExperience\" -ErrorAction SilentlyContinue\nSet-Variable -Name LogSource -Option Constant -Value \"SMEScripts\" -ErrorAction SilentlyContinue\nSet-Variable -Name ScriptName -Option Constant -Value $MyInvocation.ScriptName -ErrorAction SilentlyContinue\nfunction getClusterPowerShellSupport() {\n$cmdletInfo = Get-Command \u0027Get-ClusterNode\u0027 -ErrorAction SilentlyContinue\nreturn $cmdletInfo -and $cmdletInfo.Name -eq \"Get-ClusterNode\"\n}\nfunction getClusterNodeCimInstances() {\nreturn Get-CimInstance -Namespace root/mscluster MSCluster_Node -ErrorAction SilentlyContinue | `\nMicrosoft.PowerShell.Utility\\Select-Object @{Name=\"DrainStatus\"; Expression={$_.NodeDrainStatus}}, DynamicWeight, Name, NodeWeight, FaultDomain, State\n}\nfunction getClusterNodePsInstances() {\nreturn Get-ClusterNode -ErrorAction SilentlyContinue | Microsoft.PowerShell.Utility\\Select-Object DrainStatus, DynamicWeight, Name, NodeWeight, FaultDomain, State\n}\nfunction getClusterNodeFqdn([string]$clusterNodeName) {\nreturn ([System.Net.Dns]::GetHostEntry($clusterNodeName)).HostName\n}\nfunction writeToEventLog([string]$message) {\nMicrosoft.PowerShell.Management\\New-EventLog -LogName $LogName -Source $LogSource -ErrorAction SilentlyContinue\nMicrosoft.PowerShell.Management\\Write-EventLog -LogName $LogName -Source $LogSource -EventId 0 -Category 0 -EntryType Warning `\n-Message $message -ErrorAction SilentlyContinue\n}\nfunction getClusterNodes() {\n$isClusterCmdletAvailable = getClusterPowerShellSupport\nif ($isClusterCmdletAvailable) {\n$clusterNodes = getClusterNodePsInstances\n} else {\n$clusterNodes = getClusterNodeCimInstances\n}\n$clusterNodeMap = @{}\nforeach ($clusterNode in $clusterNodes) {\n$clusterNodeName = $clusterNode.Name.ToLower()\ntry\n{\n$clusterNodeFqdn = getClusterNodeFqdn $clusterNodeName -ErrorAction SilentlyContinue\n}\ncatch\n{\n$clusterNodeFqdn = $clusterNodeName\nwriteToEventLog \"[$ScriptName]: The fqdn for node \u0027$clusterNodeName\u0027 could not be obtained. Defaulting to machine name \u0027$clusterNodeName\u0027\"\n}\n$clusterNodeResult = New-Object PSObject\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027FullyQualifiedDomainName\u0027 -Value $clusterNodeFqdn\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027Name\u0027 -Value $clusterNodeName\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027DynamicWeight\u0027 -Value $clusterNode.DynamicWeight\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027NodeWeight\u0027 -Value $clusterNode.NodeWeight\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027FaultDomain\u0027 -Value $clusterNode.FaultDomain\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027State\u0027 -Value $clusterNode.State\n$clusterNodeResult | Add-Member -MemberType NoteProperty -Name \u0027DrainStatus\u0027 -Value $clusterNode.DrainStatus\n$clusterNodeMap.Add($clusterNodeName, $clusterNodeResult)\n}\nreturn $clusterNodeMap\n}\ngetClusterNodes\n"
};
PowerShellScripts.Get_ServerInventory = {
command: 'Get-ServerInventory',
script: "##Get-ServerInventory##:Get-ServerInventory.ps1\nSet-StrictMode -Version 5.0\nImport-Module CimCmdlets\nImport-Module Storage -ErrorAction SilentlyContinue\nfunction convertOsVersion([string]$osVersion) {\n[Ref]$parsedVersion = $null\nif (![Version]::TryParse($osVersion, $parsedVersion)) {\nreturn $null\n}\n$version = [Version]$parsedVersion.Value\nreturn New-Object Version -ArgumentList $version.Major, $version.Minor\n}\nfunction isCredSSPEnabled() {\nSet-Variable credSSPServicePath -Option Constant -Value \"WSMan:\\localhost\\Service\\Auth\\CredSSP\"\nSet-Variable credSSPClientPath -Option Constant -Value \"WSMan:\\localhost\\Client\\Auth\\CredSSP\"\n$credSSPServerEnabled = $false;\n$credSSPClientEnabled = $false;\n$credSSPServerService = Get-Item $credSSPServicePath -ErrorAction SilentlyContinue\nif ($credSSPServerService) {\n$credSSPServerEnabled = [System.Convert]::ToBoolean($credSSPServerService.Value)\n}\n$credSSPClientService = Get-Item $credSSPClientPath -ErrorAction SilentlyContinue\nif ($credSSPClientService) {\n$credSSPClientEnabled = [System.Convert]::ToBoolean($credSSPClientService.Value)\n}\nreturn ($credSSPServerEnabled -or $credSSPClientEnabled)\n}\nfunction isHyperVRoleInstalled() {\n$vmmsService = Get-Service -Name \"VMMS\" -ErrorAction SilentlyContinue\nreturn $vmmsService -and $vmmsService.Name -eq \"VMMS\"\n}\nfunction isHyperVPowerShellSupportInstalled() {\nreturn !!(Get-Module -ListAvailable Hyper-V -ErrorAction SilentlyContinue)\n}\nfunction isWMF5Installed([string] $operatingSystemVersion) {\nSet-Variable Server2016 -Option Constant -Value (New-Object Version \u002710.0\u0027) # And Windows 10 client SKUs\nSet-Variable Server2012 -Option Constant -Value (New-Object Version \u00276.2\u0027)\n$version = convertOsVersion $operatingSystemVersion\nif (-not $version) {\nreturn $false\n}\nif ($version -ge $Server2016) {\nreturn $true\n}\nelse {\nif ($version -ge $Server2012) {\n$registryKey = \u0027HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\3\\PowerShellEngine\u0027\n$registryKeyValue = Get-ItemProperty -Path $registryKey -Name PowerShellVersion -ErrorAction SilentlyContinue\nif ($registryKeyValue -and ($registryKeyValue.PowerShellVersion.Length -ne 0)) {\n$installedWmfVersion = [Version]$registryKeyValue.PowerShellVersion\nif ($installedWmfVersion -ge [Version]\u00275.0\u0027) {\nreturn $true\n}\n}\n}\n}\nreturn $false\n}\nfunction isUserAnAdministrator() {\nreturn ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] \"Administrator\")\n}\nfunction getClusterInformation() {\n$returnValues = @{ }\n$returnValues.IsS2dEnabled = $false\n$returnValues.IsCluster = $false\n$returnValues.ClusterFqdn = $null\n$returnValues.IsBritannicaEnabled = $false\n$namespace = Get-CimInstance -Namespace root/MSCluster -ClassName __NAMESPACE -ErrorAction SilentlyContinue\nif ($namespace) {\n$cluster = Get-CimInstance -Namespace root/MSCluster -ClassName MSCluster_Cluster -ErrorAction SilentlyContinue\nif ($cluster) {\n$returnValues.IsCluster = $true\n$returnValues.ClusterFqdn = $cluster.Fqdn\n$returnValues.IsS2dEnabled = !!(Get-Member -InputObject $cluster -Name \"S2DEnabled\") -and ($cluster.S2DEnabled -gt 0)\n$returnValues.IsBritannicaEnabled = $null -ne (Get-CimInstance -Namespace root/sddc/management -ClassName SDDC_Cluster -ErrorAction SilentlyContinue)\n}\n}\nreturn $returnValues\n}\nfunction getComputerFqdnAndAddress($computerName) {\n$hostEntry = [System.Net.Dns]::GetHostEntry($computerName)\n$addressList = @()\nforeach ($item in $hostEntry.AddressList) {\n$address = New-Object PSObject\n$address | Add-Member -MemberType NoteProperty -Name \u0027IpAddress\u0027 -Value $item.ToString()\n$address | Add-Member -MemberType NoteProperty -Name \u0027AddressFamily\u0027 -Value $item.AddressFamily.ToString()\n$addressList += $address\n}\n$result = New-Object PSObject\n$result | Add-Member -MemberType NoteProperty -Name \u0027Fqdn\u0027 -Value $hostEntry.HostName\n$result | Add-Member -MemberType NoteProperty -Name \u0027AddressList\u0027 -Value $addressList\nreturn $result\n}\nfunction getHostFqdnAndAddress($computerSystem) {\n$computerName = $computerSystem.DNSHostName\nif (!$computerName) {\n$computerName = $computerSystem.Name\n}\nreturn getComputerFqdnAndAddress $computerName\n}\nfunction getManagementToolsSupportInformation() {\n$returnValues = @{ }\n$returnValues.ManagementToolsAvailable = $false\n$returnValues.ServerManagerAvailable = $false\n$namespaces = Get-CimInstance -Namespace root/microsoft/windows -ClassName __NAMESPACE -ErrorAction SilentlyContinue\nif ($namespaces) {\n$returnValues.ManagementToolsAvailable = !!($namespaces | Where-Object { $_.Name -ieq \"ManagementTools\" })\n$returnValues.ServerManagerAvailable = !!($namespaces | Where-Object { $_.Name -ieq \"ServerManager\" })\n}\nreturn $returnValues\n}\nfunction isRemoteAppEnabled() {\nSet-Variable key -Option Constant -Value \"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Terminal Server\\\\TSAppAllowList\"\n$registryKeyValue = Get-ItemProperty -Path $key -Name fDisabledAllowList -ErrorAction SilentlyContinue\nif (-not $registryKeyValue) {\nreturn $false\n}\nreturn $registryKeyValue.fDisabledAllowList -eq 1\n}\nfunction getOperatingSystemInfo() {\n$operatingSystemInfo = Get-CimInstance Win32_OperatingSystem | Microsoft.PowerShell.Utility\\Select-Object csName, Caption, OperatingSystemSKU, Version, ProductType, OSType, LastBootUpTime, SerialNumber\n$currentVersion = Get-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\" | Microsoft.PowerShell.Utility\\Select-Object CurrentBuild, UBR, DisplayVersion\n$operatingSystemInfo | Add-Member -MemberType NoteProperty -Name CurrentBuild -Value $currentVersion.CurrentBuild\n$operatingSystemInfo | Add-Member -MemberType NoteProperty -Name UpdateBuildRevision -Value $currentVersion.UBR\n$operatingSystemInfo | Add-Member -MemberType NoteProperty -Name DisplayVersion -Value $currentVersion.DisplayVersion\nreturn $operatingSystemInfo\n}\nfunction getComputerSystemInfo() {\nreturn Get-CimInstance Win32_ComputerSystem -ErrorAction SilentlyContinue | `\nMicrosoft.PowerShell.Utility\\Select-Object TotalPhysicalMemory, DomainRole, Manufacturer, Model, NumberOfLogicalProcessors, Domain, Workgroup, DNSHostName, Name, PartOfDomain, SystemFamily, SystemSKUNumber\n}\nfunction getSmbiosData($computerSystem) {\n$ChassisTypes =\n@{\n1 = \u0027Other\u0027\n2 = \u0027Unknown\u0027\n3 = \u0027Desktop\u0027\n4 = \u0027Low Profile Desktop\u0027\n5 = \u0027Pizza Box\u0027\n6 = \u0027Mini Tower\u0027\n7 = \u0027Tower\u0027\n8 = \u0027Portable\u0027\n9 = \u0027Laptop\u0027\n10 = \u0027Notebook\u0027\n11 = \u0027Hand Held\u0027\n12 = \u0027Docking Station\u0027\n13 = \u0027All in One\u0027\n14 = \u0027Sub Notebook\u0027\n15 = \u0027Space-Saving\u0027\n16 = \u0027Lunch Box\u0027\n17 = \u0027Main System Chassis\u0027\n18 = \u0027Expansion Chassis\u0027\n19 = \u0027SubChassis\u0027\n20 = \u0027Bus Expansion Chassis\u0027\n21 = \u0027Peripheral Chassis\u0027\n22 = \u0027Storage Chassis\u0027\n23 = \u0027Rack Mount Chassis\u0027\n24 = \u0027Sealed-Case PC\u0027\n25 = \u0027Multi-system chassis\u0027\n26 = \u0027Compact PCI\u0027\n27 = \u0027Advanced TCA\u0027\n28 = \u0027Blade\u0027\n29 = \u0027Blade Enclosure\u0027\n30 = \u0027Tablet\u0027\n31 = \u0027Convertible\u0027\n32 = \u0027Detachable\u0027\n33 = \u0027IoT Gateway\u0027\n34 = \u0027Embedded PC\u0027\n35 = \u0027Mini PC\u0027\n36 = \u0027Stick PC\u0027\n}\n$list = New-Object System.Collections.ArrayList\n$win32_Bios = Get-CimInstance -class Win32_Bios\n$obj = New-Object -Type PSObject | Microsoft.PowerShell.Utility\\Select-Object SerialNumber, Manufacturer, UUID, BaseBoardProduct, ChassisTypes, Chassis, SystemFamily, SystemSKUNumber, SMBIOSAssetTag\n$obj.SerialNumber = $win32_Bios.SerialNumber\n$obj.Manufacturer = $win32_Bios.Manufacturer\n$computerSystemProduct = Get-CimInstance Win32_ComputerSystemProduct\nif ($null -ne $computerSystemProduct) {\n$obj.UUID = $computerSystemProduct.UUID\n}\n$baseboard = Get-CimInstance Win32_BaseBoard\nif ($null -ne $baseboard) {\n$obj.BaseBoardProduct = $baseboard.Product\n}\n$systemEnclosure = Get-CimInstance Win32_SystemEnclosure\nif ($null -ne $systemEnclosure) {\n$obj.SMBIOSAssetTag = $systemEnclosure.SMBIOSAssetTag\n}\n$obj.ChassisTypes = Get-CimInstance Win32_SystemEnclosure | Microsoft.PowerShell.Utility\\Select-Object -ExpandProperty ChassisTypes\n$obj.Chassis = New-Object -TypeName \u0027System.Collections.ArrayList\u0027\n$obj.ChassisTypes | ForEach-Object -Process {\n$obj.Chassis.Add($ChassisTypes[[int]$_])\n}\n$obj.SystemFamily = $computerSystem.SystemFamily\n$obj.SystemSKUNumber = $computerSystem.SystemSKUNumber\n$list.Add($obj) | Out-Null\nreturn $list\n}\nfunction getAzureArcStatus() {\n$LogName = \"Microsoft-ServerManagementExperience\"\n$LogSource = \"SMEScript\"\n$ScriptName = \"Get-ServerInventory.ps1 - getAzureArcStatus()\"\nMicrosoft.PowerShell.Management\\New-EventLog -LogName $LogName -Source $LogSource -ErrorAction SilentlyContinue\nGet-Service -Name himds -ErrorVariable Err -ErrorAction SilentlyContinue | Out-Null\nif (!!$Err) {\n$Err = \"The Azure arc agent is not installed. Details: $Err\"\nMicrosoft.PowerShell.Management\\Write-EventLog -LogName $LogName -Source $LogSource -EventId 0 -Category 0 -EntryType Information `\n-Message \"[$ScriptName]: $Err\" -ErrorAction SilentlyContinue\n$status = \"NotInstalled\"\n}\nelse {\n$status = (azcmagent show --json | ConvertFrom-Json -ErrorAction Stop).status\n}\nreturn $status\n}\nfunction getSystemLockdownPolicy() {\nreturn [System.Management.Automation.Security.SystemPolicy]::GetSystemLockdownPolicy().ToString()\n}\nfunction isServerOsHCI([string] $operatingSystemCaption) {\nreturn $operatingSystemCaption -eq \"Microsoft Azure Stack HCI\"\n}\n$operatingSystem = getOperatingSystemInfo\n$computerSystem = getComputerSystemInfo\n$isAdministrator = isUserAnAdministrator\n$fqdnAndAddress = getHostFqdnAndAddress $computerSystem\n$hostname = [Environment]::MachineName\n$netbios = $env:ComputerName\n$managementToolsInformation = getManagementToolsSupportInformation\n$isWmfInstalled = isWMF5Installed $operatingSystem.Version\n$clusterInformation = getClusterInformation -ErrorAction SilentlyContinue\n$isHyperVPowershellInstalled = isHyperVPowerShellSupportInstalled\n$isHyperVRoleInstalled = isHyperVRoleInstalled\n$isCredSSPEnabled = isCredSSPEnabled\n$isRemoteAppEnabled = isRemoteAppEnabled\n$smbiosData = getSmbiosData $computerSystem\n$azureArcStatus = getAzureArcStatus\n$systemLockdownPolicy = getSystemLockdownPolicy\n$isHciServer = isServerOsHCI $operatingSystem.Caption\n$result = New-Object PSObject\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsAdministrator\u0027 -Value $isAdministrator\n$result | Add-Member -MemberType NoteProperty -Name \u0027OperatingSystem\u0027 -Value $operatingSystem\n$result | Add-Member -MemberType NoteProperty -Name \u0027ComputerSystem\u0027 -Value $computerSystem\n$result | Add-Member -MemberType NoteProperty -Name \u0027Fqdn\u0027 -Value $fqdnAndAddress.Fqdn\n$result | Add-Member -MemberType NoteProperty -Name \u0027AddressList\u0027 -Value $fqdnAndAddress.AddressList\n$result | Add-Member -MemberType NoteProperty -Name \u0027Hostname\u0027 -Value $hostname\n$result | Add-Member -MemberType NoteProperty -Name \u0027NetBios\u0027 -Value $netbios\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsManagementToolsAvailable\u0027 -Value $managementToolsInformation.ManagementToolsAvailable\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsServerManagerAvailable\u0027 -Value $managementToolsInformation.ServerManagerAvailable\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsWmfInstalled\u0027 -Value $isWmfInstalled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsCluster\u0027 -Value $clusterInformation.IsCluster\n$result | Add-Member -MemberType NoteProperty -Name \u0027ClusterFqdn\u0027 -Value $clusterInformation.ClusterFqdn\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsS2dEnabled\u0027 -Value $clusterInformation.IsS2dEnabled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsBritannicaEnabled\u0027 -Value $clusterInformation.IsBritannicaEnabled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsHyperVRoleInstalled\u0027 -Value $isHyperVRoleInstalled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsHyperVPowershellInstalled\u0027 -Value $isHyperVPowershellInstalled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsCredSSPEnabled\u0027 -Value $isCredSSPEnabled\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsRemoteAppEnabled\u0027 -Value $isRemoteAppEnabled\n$result | Add-Member -MemberType NoteProperty -Name \u0027SmbiosData\u0027 -Value $smbiosData\n$result | Add-Member -MemberType NoteProperty -Name \u0027AzureArcStatus\u0027 -Value $azureArcStatus\n$result | Add-Member -MemberType NoteProperty -Name \u0027SystemLockdownPolicy\u0027 -Value $systemLockdownPolicy\n$result | Add-Member -MemberType NoteProperty -Name \u0027IsHciServer\u0027 -Value $isHciServer\n$result\n"
};
})(PowerShellScripts || (PowerShellScripts = {}));
//# sourceMappingURL=powershell-scripts.js.map