Hi All
I'm trying to check and create a folder to collect LOGs, unfortunatelly without success 
the script should, first check the folder and the path, then create a folder if the checkdir return"False"
- the folder should be HardeningESXi-Logs+date
- the folder for SessionsLoGFiles should be SessionsLoGFiles+date
#Connect to vcenter
$vcenter = Read-Host "vCenter name:"
$user = Read-Host "User:"
$password = Read-Host "Password:"
Write-Host -f green "Connecting to vCenter Server..."
Connect-VIServer -Server $vcenter -User $user -Password $password
$prefixe=$(get-date -format 'yyyy.MM.dd_HH.mm.ss_')
#information where log files sessions are uploaded
$SessionsLoGFiles=".\HardeningESXi\"+ $prefixe+ "SessionsLoGFiles.log"
#Create folder for logs output
$checkdir = Test-Path ".\HardeningESXi\HardeningESXi-Logs" -PathType Container
if ($checkdir -eq "*True*"){}
else {New-Item .\HardeningESXi\HardeningESXi-Logs -ItemType directory}