28 lines
645 B
PowerShell
28 lines
645 B
PowerShell
|
|
$FolderName="c:\Steamware\Logs"
|
|
$Logfile = Join-Path $FolderName "\GPW_checkProj.log"
|
|
$callUri = "https://iis01.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)
|