30 lines
935 B
PowerShell
30 lines
935 B
PowerShell
param ([string]$target)
|
|
|
|
$allowedUserList= (
|
|
'RCINET\madachf',
|
|
'RCINET\ersekz',
|
|
'RCINET\jakaba',
|
|
'RCINET\retinagyt',
|
|
'RCINET\egyediz')
|
|
$user = Get-WmiObject Win32_ComputerSystem | select username
|
|
|
|
$isRunEnabled = $TRUE
|
|
$isAlwaysRunEnabled = $FALSE
|
|
|
|
if($isAlwaysRunEnabled -OR ($isRunEnabled -AND ($allowedUserList -Contains $user.username)))
|
|
{
|
|
Add-Type -AssemblyName "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
|
|
$webResposne = Invoke-WebRequest -Uri "https://biatorbagyi.ekreta.hu/ellenorzo/swagger/docs/V3"
|
|
|
|
if($webResposne.StatusCode -eq 200)
|
|
{
|
|
Out-File -FilePath $target\swagger.json -InputObject $webResposne.Content -Force
|
|
Write-Host "$target\swagger.json VN kész."
|
|
}
|
|
else
|
|
{
|
|
$top = new-Object System.Windows.Forms.Form -property @{Topmost=$true}
|
|
[System.Windows.Forms.MessageBox]::Show($top,"Hibás VN Swagger!",'Error',1,'Error')
|
|
}
|
|
}
|