feat: add self-contained Windows build and Intune deployment scripts docs: document configuration, permissions, and deployment ci: build x64 and arm64 agent artifacts
11 lines
545 B
PowerShell
11 lines
545 B
PowerShell
param([string]$InstallDirectory = "$env:ProgramFiles\NetBox Windows Agent")
|
|
$ErrorActionPreference = 'Stop'
|
|
schtasks.exe /Delete /TN 'NetBox Windows Agent' /F 2>$null
|
|
if (Test-Path -LiteralPath $InstallDirectory) {
|
|
$resolved = (Resolve-Path -LiteralPath $InstallDirectory).Path
|
|
$programFiles = (Resolve-Path -LiteralPath $env:ProgramFiles).Path
|
|
if (-not $resolved.StartsWith($programFiles + '\', [StringComparison]::OrdinalIgnoreCase)) { throw "Unsicheres Ziel: $resolved" }
|
|
Remove-Item -LiteralPath $resolved -Recurse -Force
|
|
}
|
|
|