Created
November 19, 2015 16:52
-
-
Save jleechpe/a584a3625e15b2ea0f07 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[CMDLetBinding()] | |
param([string]$VMNameStr) | |
Write-Verbose "Splitting list of VM Names based on commas. Excess whitespace is trimmed. Empty names are omitted." | |
Write-Verbose "Use -OutVariable to assign to a variable if needed." | |
# Trim before calculating length to ensure no blank lines. | |
$VMNameStr.split(',').trim() | ? length -gt 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment