Last active
September 7, 2022 08:55
-
-
Save Diagg/73275dff62381eb85ad96c6fc15fea81 to your computer and use it in GitHub Desktop.
Convert DsRegCmd to a Powershell object with a oneliner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspiration from https://gist.github.com/d4rkeagle65/b9bc42a26be44a6d66c4858a4c3bc944 by d4rkeagle65 | |
# Output to object by Diagg/OSD-Couture.com | |
$Dsregcmd = New-Object PSObject ; Dsregcmd /status | Where {$_ -match ' : '}|ForEach {$Item = $_.Trim() -split '\s:\s'; $Dsregcmd|Add-Member -MemberType NoteProperty -Name $($Item[0] -replace '[:\s]','') -Value $Item[1] -EA SilentlyContinue} | |
# to vue full objest type : $Dsregcmd | |
# to vue property TenantID : $Dsregcmd.TenantId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment