Add ALD Transition Console preview and Astra lab build workflow
This commit is contained in:
1 parent
f330a3c00a
commit
e5c6a2fc0e
199 files changed
+9866
No files matched your search
@@ -0,0 +1,34 @@
|
||||
# ALD Transition Console / fixed read-only task / Windows PowerShell 5.1
|
||||
# No PowerShell SSH subsystem, profile, background job or persistent task.
|
||||
$ErrorActionPreference = 'Stop'
|
||||
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
|
||||
$errors = New-Object 'System.Collections.Generic.List[string]'
|
||||
$os = Get-CimInstance -ClassName Win32_OperatingSystem
|
||||
$computer = Get-CimInstance -ClassName Win32_ComputerSystem
|
||||
$features = @()
|
||||
try {
|
||||
$features = @(Get-WindowsCapability -Online | Where-Object { $_.Name -like 'OpenSSH*' } | ForEach-Object {
|
||||
@{ name = $_.Name; state = [string]$_.State }
|
||||
})
|
||||
} catch { $errors.Add('Optional-feature inventory unavailable: elevation or servicing prerequisite required.') }
|
||||
$ssh = Get-Service -Name sshd -ErrorAction SilentlyContinue
|
||||
$result = @{
|
||||
schema_version = 1
|
||||
task = 'windows.discovery'
|
||||
observed_at = [DateTime]::UtcNow.ToString('o')
|
||||
os_edition = $os.Caption
|
||||
os_release = $os.Version
|
||||
os_build = $os.BuildNumber
|
||||
architecture = $os.OSArchitecture
|
||||
domain_role = [int]$computer.DomainRole
|
||||
part_of_domain = [bool]$computer.PartOfDomain
|
||||
domain = $computer.Domain
|
||||
name = $computer.Name
|
||||
powershell_version = $PSVersionTable.PSVersion.ToString()
|
||||
optional_features = $features
|
||||
feature_inventory_complete = ($errors.Count -eq 0)
|
||||
sshd_state = $(if ($null -eq $ssh) { 'NOT_INSTALLED' } else { [string]$ssh.Status })
|
||||
errors = @($errors)
|
||||
synthetic = $false
|
||||
}
|
||||
$result | ConvertTo-Json -Depth 8 -Compress
|
||||
Reference in new issue
Block a user