mirror of
https://gitlab.com/JKANetwork/powerfulcomputermanager.git
synced 2026-03-05 01:42:06 +01:00
Fix bugs and started translation.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user