function InstallNASDrive { net use N: $NASDrive /persistent:Yes }
function InstallNettopDrive { net use N: $NettopDrive /persistent:Yes }
if ( $CompName -eq 'NETTOP-SQUARE' ){
Write-Host $CompName
}
# Map NAS Drive
Do
{
$NetDriveName = Get-CimInstance -classname Win32_NetworkConnection | select-object -expandproperty "RemoteName"
if (([bool] ($null)) -eq $NetDriveName )
net use N: $NASDrive /persistent:Yes
}
Until (([bool]( $NetDriveName -contains $NASDrive )))
else
{
Write-Host "Map Network Drive"
}
# Map NAS & Nettop Drive
InstallNettopDrive
Start-Sleep -Seconds 2
InstallNASDrive
char:44
+ if (([bool] ($null)) -eq $NetDriveName )
+ ~
Missing statement block after if ( condition ).
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : MissingStatementBlock
if (([bool] ($null)) -eq $NetDriveName ) {
Write-Host "NetDriveName is null"
}
if (([bool] ($null)) -eq $NetDriveName )
if (-not $NetDriveName) {
net use
}