Using the following code, we are declaring a variable $DemoString but not assigning it a value. Let’s look at how to test for these conditions.
However, not having a value may mean a couple of different things: Therefore, if a variable doesn’t have value, this is something we would want to check against in our conditional logic flow. We typically then choose to act upon that value. More often than not, we create variables with the intent they will hold a value. Learn the difference between a null, empty string, and white space value for a PowerShell variable and how to test for them.