Solve WMI problems on Hyper-V to SCVMM
Fix a common WMI problem for SCVMM to Hyper-V
John Savill
February 10, 2017
1 Min Read
![Solve WMI problems on Hyper-V to SCVMM Solve WMI problems on Hyper-V to SCVMM](https://eu-images.contentstack.com/v3/assets/blt07f68461ccd75245/blte66b6df0e6b7364a/661cf9281ef3d7f1bb6e8f4a/twine-1927967960720_0_4.jpg?width=1280&auto=webp&quality=95&format=jpg&disable=upscale)
Q. How can i split a PowerShell string into parts?
A. PowerShell strings have a split function that enables the simple splitting of a string into an array of strings based on a delimiter character.
The example below splits based on the space character and removes any entries that have no actual content.
$FullName = "John Savill "
$Names = $FullName.Split(" ",[StringSplitOptions]'RemoveEmptyEntries')
$Names would contain two entries: John and Savill. The trailing spaces were removed.
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like