first commit

This commit is contained in:
2026-02-04 09:38:45 -06:00
commit 130afb7baa
3 changed files with 35 additions and 0 deletions

BIN
HJLaw.ppkg Normal file

Binary file not shown.

0
README.md Normal file
View File

35
hjinstall.ps1 Normal file
View File

@@ -0,0 +1,35 @@
function Join-HJLaw
{
param(
[string]$DeviceName
)
if (-not $DeviceName -eq "")
{
Rename-Computer -NewName $DeviceName
}
$ppkg = $false
Get-ProvisioningPackage -AllInstalledPackages | ForEach-Object {
if($_.PackagePath -like "*HJLaw*")
{
if ($_.IsInstalled)
{
$ppkg = $true
}
}
}
if (-not $ppkg)
{
$registryPath = "HKLM:\SOFTWARE\Microsoft\Enrollments"
$subKeys = Get-ChildItem -Path $registryPath
foreach ($subKey in $subKeys)
{
Remove-Item -Path "$registryPath\$($subKey.PSChildName)" -Recurse -Force
}
dsregcmd /leave
Uninstall-ProvisioningPackage -AllInstalledPackages
Install-ProvisioningPackage -PackagePath '.\HJLaw.ppkg' -QuietInstall -Force
dsregcmd /status
}
}