Hi all,
On looking through a script example for confguring DSC pull server, I found out the following command:
$null = New-Item -ItemType container -Path $path01 $binFolderPath_IIS = Join-Path $path01 "folder" $null = New-Item -path $binFolderPath_IIS -itemType "directory" -Force Copy-Item $dependentBinaries $binFolderPath_IIS -Force $muiPath_01 = Join-Path $binFolderPath_IIS $language if (!(Test-Path $muiPath_01)) { $null = New-Item -ItemType container $muiPath_01 } Copy-Item $dependentMUIFiles $muiPath_01 -Force Copy-Item $cfgfile (Join-Path $path01 "web.config") -Force Copy-Item $svc $path01 -Force Copy-Item $mof $path01 -Force Copy-Item $dispatch $path01 -Force Copy-Item $asax $path01 -Force
I state in advance that I am a newbie in PS, but so far I have seen the $null usage for
clearing the value of a variable only, see below:
PS C:\Users\user1\Desktop> $myVar = "Hello World!" PS C:\Users\user1\Desktop> $myVar = $null PS C:\Users\user1\Desktop> $myVar PS C:\Users\user1\Desktop>I guess that I am still missing something on the usage of $null in the 1st example; so
what's the purpose of $null when it sets on left of the " = "(equal sign), and the related
outcome?
Thanks in advance for your help.
Leo
I