In below code, I need to check if version string is not empty then append its value to the request variable.
if ([string]::IsNullOrEmpty($version)) { $re
if (!$variablename) { Write-Host "variable is null" }
I hope this simple answer will is resolve the question. Source