Skip to content

Instantly share code, notes, and snippets.

@d4rkeagle65
Created November 21, 2020 18:06
Show Gist options
  • Save d4rkeagle65/b9bc42a26be44a6d66c4858a4c3bc944 to your computer and use it in GitHub Desktop.
Save d4rkeagle65/b9bc42a26be44a6d66c4858a4c3bc944 to your computer and use it in GitHub Desktop.
Parse dsregcmd.exe output to powershell name/value pairs.
$dsregcmd = dsregcmd /status | Where-Object { $_ -match ' : ' } | ForEach-Object { $_.Trim() } | ConvertFrom-String -PropertyNames 'Name','Value' -Delimiter ' : '
@marinegeek23
Copy link

You are my savior!

@Bpop161
Copy link

Bpop161 commented Sep 23, 2024

how can I store 'DeviceId' value as veriable?
this might be stupid question I'm sorry :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment