mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
f36b7d4d6d
#17043 Set up dogfood to use gitops. I copied the current dogfood configs/policies/queries into the gitops flow. Successful workflow run: https://github.com/fleetdm/fleet/actions/runs/8023101797/job/21918883543?pr=17098 --------- Co-authored-by: Noah Talerman <noahtal@umich.edu>
28 lines
697 B
PowerShell
28 lines
697 B
PowerShell
Add-Type -TypeDefinition @"
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
public class MdmRegistration
|
|
{
|
|
[DllImport("mdmregistration.dll", SetLastError = true)]
|
|
public static extern int UnregisterDeviceWithManagement(IntPtr pDeviceID);
|
|
|
|
public static int UnregisterDevice()
|
|
{
|
|
return UnregisterDeviceWithManagement(IntPtr.Zero);
|
|
}
|
|
}
|
|
"@ -Language CSharp
|
|
|
|
try {
|
|
$result = [MdmRegistration]::UnregisterDevice()
|
|
|
|
if ($result -ne 0) {
|
|
throw "UnregisterDeviceWithManagement failed with error code: $result"
|
|
}
|
|
|
|
Write-Host "Device unregistration called successfully."
|
|
} catch {
|
|
Write-Error "Error calling UnregisterDeviceWithManagement: $_"
|
|
}
|