Fix bugs and started translation.

This commit is contained in:
2019-06-17 12:37:01 +02:00
parent 4967364ce1
commit 746765a146
6 changed files with 313 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
# Build 5
# Build 7
$root = $PSCommandPath | Split-Path -Parent
$server = (Get-Content "$root\configpcm.ini" | select -Skip 1 | ConvertFrom-StringData).server
$resources = (Get-Content "$root\configpcm.ini" | select -Skip 1 | ConvertFrom-StringData).resources
@@ -9,8 +9,12 @@ $UUID=(get-wmiobject Win32_ComputerSystemProduct).UUID
$exists = Invoke-RestMethod -Method Get -Uri "$server/get/computerexists?ComputerName=$computerName&UUID=$UUID"
if ($exists.Result -eq "ERROR"){
Write-Host "Computer outside database:" $computerName
exit
if ($exists.EXITCODE -eq '1'){
Write-Host "Computer outside database:" $computerName
}else{
Write-Host "Computer and UUID of $computerName doesn't match"
}
exit
}
$Timestamp = [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds
@@ -100,7 +104,13 @@ foreach ($CookName in $cooks){
Invoke-Expression $param
if ($? -eq $false){ # Error in CMD
$err = 1
}
}
}
"PWSCRIPT" { # Run a powershell script. Note: Runs as high priv.
Invoke-Expression -Command $param
if ($? -eq $false){ # Error in Script
$err = 1
}
}
"REPOTOLOCAL" { # Copy file from repo location to local ($env:temp) for use in cmd or other things
Copy-Item "$resources\$param" $env:temp -ErrorVariable errvar -Recurse -Force