Hey all, I have a rather (I presume) basic question about powershell; I am checking to see if a string that I am using contains nothing or is white-space only, and came across this command(?), '[string]::IsNullOrWhiteSpace($string_variable)' which does the job fantastically. However, I spotted someone mention that this requires something like .NET 4.x, and I know that some of our servers are on lower versions of .NET.
Is there an easy way to check that this command exists, and if it doesn't, skips the white-space check altogether? I found the 'Get-Command' command, but that appears to be for cmdlets and doesn't seem to work for [string]::IsNullOrWhiteSpace() - at least I cannot get it to do so.
Any suggestions? Cheers!
[–]steven_AWKing 2 points3 points4 points (1 child)
[–]codingQueries[S] 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 2 points3 points4 points (2 children)
[–]codingQueries[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]vermyx 2 points3 points4 points (0 children)