Update
This commit is contained in:
@@ -20,10 +20,28 @@ function CheckOfficeInstall {
|
||||
InstallOffice
|
||||
}
|
||||
Write-Host "Activating Windows and Office..."
|
||||
$status = CheckActivation
|
||||
|
||||
ActivateWindowsOffice
|
||||
Write-Host "Windows and Office activation complete!"
|
||||
}
|
||||
|
||||
function CheckActivation {
|
||||
$osLicense = Get-CimInstance -ClassName SoftwareLicensingProduct | Where-Object { $_.Description -match "Windows" }
|
||||
$officeLicense = Get-CimInstance -ClassName SoftwareLicensingProduct | Where-Object { $_.Description -match "Office" }
|
||||
$windows = $osLicense.Description
|
||||
$office = $officeLicense.Description
|
||||
|
||||
# if both activated return true
|
||||
if ($osLicense.LicenseStatus -eq 1 -and $officeLicense.LicenseStatus -eq 1) {
|
||||
Write-Host "Windows and Office are activated."
|
||||
return $true
|
||||
} else {
|
||||
Write-Host "Windows and Office are not activated."
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function InstallOffice {
|
||||
DownloadFiles -Type "Office"
|
||||
$imagePath = Join-Path $tmpPath "O365ProPlusRetail.img"
|
||||
|
||||
Reference in New Issue
Block a user