Last active
February 5, 2018 19:15
-
-
Save phwelo/d8c067d91aea6c8813a3 to your computer and use it in GitHub Desktop.
[Powershell WMI Converter thing] Powershell function to prefix 0's to make a deviceID from powershell WMI output #Powershell #WMI
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
#Example: Output-FixedLengthString 5 10 | |
#Output will be: 00010 | |
Function Output-FixedLengthString{ | |
param( [int]$EndLength, [string]$StrSubject ) | |
do { $StrSubject = "0$StrSubject" | |
$length = $StrSubject.length | |
} until ($length -eq $EndLength) | |
return $StrSubject | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment