$FolderName="c:\Steamware\Logs" $Logfile = Join-Path $FolderName "\GPW_checkProj.log" $callUri = "https://iis03.egalware.com/GPW/Api/api/ProjCheck/ResAlloc" Function LogWrite { Param ([string]$logstring) $Stamp = (Get-Date).toString("yyyy/MM/dd HH:mm:ss.fff") Add-content $Logfile -value "$Stamp $logstring" } LogWrite("Start CheckProj process...") if (Test-Path $FolderName) { Write-Host "Folder Exists" } else { #PowerShell Create directory if not exists New-Item $FolderName -ItemType Directory Write-Host "Folder Created successfully" } $Response = Invoke-WebRequest -URI $callUri LogWrite($Response)