Add local Windows Server inventory collection and validation; include core package

This commit is contained in:
2026-10-30 11:24:40 -07:00
parent 967b2bd46a
commit f65ade9fff
35 changed files with 2200 additions and 56 deletions

View File

@@ -0,0 +1,17 @@
function Get-SamsaraCertificates {
param($Result)
$collection = @{ stores = @() }
Invoke-SamsaraRead $Result 'Local machine certificate store list' {
$collection.stores = @(Get-ChildItem -LiteralPath 'Cert:\LocalMachine' -ErrorAction Stop)
}
foreach ($store in $collection.stores) {
Invoke-SamsaraRead $Result 'Local machine public certificate metadata' {
Get-ChildItem -LiteralPath $store.PSPath -ErrorAction Stop | ForEach-Object {
$Result.data += [pscustomobject]@{ subject = [string]$_.Subject; issuer = [string]$_.Issuer
expires = $_.NotAfter.ToUniversalTime().ToString('o'); thumbprint = [string]$_.Thumbprint
store = [string]$store.PSChildName }
}
}
}
$Result.limitations += 'Public LocalMachine certificate metadata only. Private keys, password-protected files, CurrentUser stores, application bindings and off-store certificates are not read.'
}