Compare commits
9 Commits
8e56d55a0b
...
main
Author | SHA1 | Date | |
---|---|---|---|
1ee5438c92 | |||
3f9175317c | |||
a8af307fea | |||
a951e60063 | |||
080034b176 | |||
4af8ff2fa2 | |||
d7ef359b82 | |||
bf39b4d00a | |||
f361e92ac8 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,2 @@
|
|||||||
# Do not commit any credentials files.
|
# Do not commit any credentials files.
|
||||||
Credentials-*.ps1
|
Credentials-*.ps1
|
||||||
|
|
||||||
# Do not commit any phtransfer files. They can be found here: iraven/piholesync
|
|
||||||
phtransfer*
|
|
||||||
|
@@ -9,11 +9,11 @@ $CompName = $env:COMPUTERNAME
|
|||||||
$ADCompOU = ([adsisearcher]"(&(objectClass=computer)(sAMAccountName=$CompName$))").FindOne().GetDirectoryEntry().distinguishedName
|
$ADCompOU = ([adsisearcher]"(&(objectClass=computer)(sAMAccountName=$CompName$))").FindOne().GetDirectoryEntry().distinguishedName
|
||||||
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
|
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
|
||||||
$PCNameSuffix = ($CompName.Substring($CompName.IndexOf("-")+1))
|
$PCNameSuffix = ($CompName.Substring($CompName.IndexOf("-")+1))
|
||||||
# Domain Credentials to be used
|
|
||||||
. "\\berrypunch.technolog.net\PSCredentials$\Credentials-WKSDeploy.ps1"
|
|
||||||
|
|
||||||
Function RenamePCTNGPrefix {
|
Function RenamePCTNGPrefix {
|
||||||
Write-Host "Renaming this computer to TNG-$PCNameSuffix."
|
Write-Host "Renaming this computer to TNG-$PCNameSuffix."
|
||||||
|
# Domain Credentials to be used
|
||||||
|
. "\\berrypunch.technolog.net\PSCredentials$\Credentials-WKSDeploy.ps1"
|
||||||
Rename-Computer -NewName "TNG-$PCNameSuffix" -DomainCredential $DomainCredential -Restart
|
Rename-Computer -NewName "TNG-$PCNameSuffix" -DomainCredential $DomainCredential -Restart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
32
Install-AnyConnect.ps1
Normal file
32
Install-AnyConnect.ps1
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Script to install AnyConnect VPN Client
|
||||||
|
# Technolog Networks - 2025-10-13
|
||||||
|
# iRaven
|
||||||
|
|
||||||
|
param(
|
||||||
|
[switch] $SBL
|
||||||
|
)
|
||||||
|
|
||||||
|
Start-Transcript -Path "c:\irnh\Install-AnyConnect.log" -Append
|
||||||
|
|
||||||
|
Function CheckInstall {
|
||||||
|
if (Get-Package -Name "Cisco*AnyConnect*") {
|
||||||
|
return $true
|
||||||
|
} else {
|
||||||
|
return $false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((CheckInstall) -eq $false) {
|
||||||
|
try {
|
||||||
|
Write-Host -ForegroundColor Yellow "Installing AnyConnect Core"
|
||||||
|
msiexec /i ".\CiscoAnyConnect.msi" /quiet
|
||||||
|
if ($SBL) {
|
||||||
|
Write-Host -ForegroundColor Yellow "Installing AnyConnect SBL"
|
||||||
|
msiexec /i ".\CiscoAnyConnectSBL.msi" /quiet
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
write-host "it no worky"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Stop-Transcript
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Start-Transcript -Path "c:\irnh\Install-MSOffice.log" -Append
|
Start-Transcript -Path "c:\irnh\Install-MSOffice.log" -Append
|
||||||
|
|
||||||
$SoftwareDeployLocation = "\\minuette2.technolog.net\SoftwareLibrary\Software\MSOffice"
|
$SoftwareDeployLocation = "\\minuette2.technolog.net\Software\Software\MSOffice"
|
||||||
$ParamVersion = $args[0]
|
$ParamVersion = $args[0]
|
||||||
|
|
||||||
# Office Install Checks
|
# Office Install Checks
|
||||||
@@ -18,7 +18,7 @@ $Office2024 = (Get-WmiObject -Class Win32_Product | where name -like "Microsoft
|
|||||||
Function CheckInstall {
|
Function CheckInstall {
|
||||||
if ($null -ne $OfficeVersionInstalled) {
|
if ($null -ne $OfficeVersionInstalled) {
|
||||||
if ($OfficeVersionInstalled -ge "16.0" ) { # Checks if currently installed Office is less than version 16 (2016)
|
if ($OfficeVersionInstalled -ge "16.0" ) { # Checks if currently installed Office is less than version 16 (2016)
|
||||||
if ($null -eq $Office2016 -and $ParamVersion -eq 2016) {
|
if ($null -ne $Office2016 -and $ParamVersion -eq 2016) {
|
||||||
Write-Host "Office $ParamVersion is already installed. No action will be taken."
|
Write-Host "Office $ParamVersion is already installed. No action will be taken."
|
||||||
return $true
|
return $true
|
||||||
} elseif ($null -ne $Office2019 -and $ParamVersion -eq 2019) {
|
} elseif ($null -ne $Office2019 -and $ParamVersion -eq 2019) {
|
||||||
|
@@ -6,8 +6,8 @@ Start-Transcript -Path "c:\irnh\Install-ZabbixAgent.log" -Append
|
|||||||
|
|
||||||
$InstallFolder = "C:\Program Files\Zabbix Agent"
|
$InstallFolder = "C:\Program Files\Zabbix Agent"
|
||||||
$InstallerLog = "C:\irnh\Installer-ZabbixAgent.log"
|
$InstallerLog = "C:\irnh\Installer-ZabbixAgent.log"
|
||||||
$SoftwareDeployLocation = "\\technolog.net\sysvol\technolog.net\SoftwareDeploy\zabbix_agent-7.0.9-windows-amd64-openssl.msi"
|
$SDZabbixVersion = "7.0.19" # Modify with latest version of zabbix agent in share below
|
||||||
$SDZabbixVersion = "7.0.9"
|
$SoftwareDeployLocation = "\\technolog.net\sysvol\technolog.net\SoftwareDeploy\zabbix_agent-$SDZabbixVersion-windows-amd64-openssl.msi"
|
||||||
$ZabbixVersionInstalled = (Get-WmiObject -Class Win32_Product | where name -like "Zabbix*" | select Name, Version).Version
|
$ZabbixVersionInstalled = (Get-WmiObject -Class Win32_Product | where name -like "Zabbix*" | select Name, Version).Version
|
||||||
|
|
||||||
# Zabbix settings
|
# Zabbix settings
|
||||||
@@ -15,7 +15,7 @@ $ZabbixServer = "10.10.0.90"
|
|||||||
$ZabbixAgentLogFile = "$InstallFolder\zabbix_agentd.log"
|
$ZabbixAgentLogFile = "$InstallFolder\zabbix_agentd.log"
|
||||||
|
|
||||||
Function CheckZabbixInstall {
|
Function CheckZabbixInstall {
|
||||||
if ($ZabbixVersionInstalled -ne $null) {
|
if ($null -ne $ZabbixVersionInstalled) {
|
||||||
if ($ZabbixVersionInstalled -like "$SDZabbixVersion*") {
|
if ($ZabbixVersionInstalled -like "$SDZabbixVersion*") {
|
||||||
return $true
|
return $true
|
||||||
} else {
|
} else {
|
||||||
|
@@ -10,6 +10,13 @@ Start-Transcript -Path "$MDTPath\_Logs\$CompName-JoinDomain.log" -Append
|
|||||||
$CompType = $args[0]
|
$CompType = $args[0]
|
||||||
$SubType = $args[1]
|
$SubType = $args[1]
|
||||||
|
|
||||||
|
# Check if we're already in the domain
|
||||||
|
if ((gwmi win32_computersystem).partofdomain -eq $true) {
|
||||||
|
write-host -ForegroundColor Green "Already in the domain! Exiting."
|
||||||
|
Stop-Transcript
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
if ($CompType -like "WKS") {
|
if ($CompType -like "WKS") {
|
||||||
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\LSA" -Name NetJoinLegacyAccountReuse -Value 1
|
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\LSA" -Name NetJoinLegacyAccountReuse -Value 1
|
||||||
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
|
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
|
||||||
@@ -30,6 +37,10 @@ if ($CompType -like "WKS") {
|
|||||||
Write-Host "Detected computer name as TEST - domain joining to Testing WKS OU"
|
Write-Host "Detected computer name as TEST - domain joining to Testing WKS OU"
|
||||||
$DomainOU = "OU=TestingWKS,OU=Workstations,DC=technolog,DC=net"
|
$DomainOU = "OU=TestingWKS,OU=Workstations,DC=technolog,DC=net"
|
||||||
}
|
}
|
||||||
|
elseif ($PCNamePrefix -like "HEADEND") {
|
||||||
|
Write-Host "Detected computer name as HEADEND - domain joining to Headend WKS OU"
|
||||||
|
$DomainOU = "OU=Headend,OU=Workstations,DC=technolog,DC=net"
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host "Computer name is unusual - domain joining to Standard WKS OU"
|
Write-Host "Computer name is unusual - domain joining to Standard WKS OU"
|
||||||
$DomainOU = "OU=Workstations,DC=technolog,DC=net"
|
$DomainOU = "OU=Workstations,DC=technolog,DC=net"
|
||||||
@@ -46,7 +57,7 @@ if ($CompType -like "WKS") {
|
|||||||
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
||||||
|
|
||||||
Write-Host "Domain joining to Utility OU"
|
Write-Host "Domain joining to Utility OU"
|
||||||
$DomainOU = "OU=Utility,DC=technolog,DC=net"
|
$DomainOU = "OU=Utility,OU=Workstations,DC=technolog,DC=net"
|
||||||
} else {
|
} else {
|
||||||
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
||||||
Write-Host "Domain joining to generic Computers OU"
|
Write-Host "Domain joining to generic Computers OU"
|
||||||
@@ -55,14 +66,14 @@ if ($CompType -like "WKS") {
|
|||||||
|
|
||||||
if ([boolean](get-variable "DomainOU" -ErrorAction SilentlyContinue)) {
|
if ([boolean](get-variable "DomainOU" -ErrorAction SilentlyContinue)) {
|
||||||
try {
|
try {
|
||||||
Add-Computer -DomainName technolog.net -Credential $DomainCredential -OUPath $DomainOU -Restart
|
Add-Computer -DomainName technolog.net -Credential $DomainCredential -OUPath $DomainOU
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Couldn't join the domain with OU $DomainOU"
|
Write-Host "Couldn't join the domain with OU $DomainOU"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
Add-Computer -DomainName technolog.net -Credential $DomainCredential -Restart
|
Add-Computer -DomainName technolog.net -Credential $DomainCredential
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Couldn't join the domain!"
|
Write-Host "Couldn't join the domain!"
|
||||||
}
|
}
|
||||||
|
@@ -1,79 +1,87 @@
|
|||||||
# Testing MDT bullshit
|
# Script to join domain inside of MDT.
|
||||||
# Technolog Networks
|
# Technolog Networks, 2024-08-12
|
||||||
# iRaven
|
# iRaven
|
||||||
|
|
||||||
$CompName = $env:COMPUTERNAME
|
|
||||||
Start-Transcript -Path "c:\$CompName-TESTScript.log" -Append
|
|
||||||
|
|
||||||
# General necessities.
|
# General necessities.
|
||||||
|
$CompName = $env:COMPUTERNAME
|
||||||
$TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment
|
$TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment
|
||||||
|
$MDTPath = $Global:TSEnv.Value("DeployRoot")
|
||||||
|
Start-Transcript -Path "$MDTPath\_Logs\$CompName-JoinDomain.log" -Append
|
||||||
$CompType = $args[0]
|
$CompType = $args[0]
|
||||||
$SubType = $args[1]
|
$SubType = $args[1]
|
||||||
|
|
||||||
Write-Host "Username: $env:username"
|
Function CheckDomainJoin { # Check if we're already domain joined
|
||||||
Write-Host "MDT DeployRoot: $Global:TSEnv.Value("DeployRoot")"
|
if ((gwmi Win32_ComputerSystem).partofdomain -eq $true -and (gwmi Win32_ComputerSystem).domain -eq "technolog.net") {
|
||||||
$MDTun = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($Global:TSEnv.Value("SMSConnectNetworkFolderAccount")))
|
write-host "Already part of the domain!"
|
||||||
Write-Host "MDT UserName: $MDTun"
|
return true
|
||||||
|
|
||||||
Read-Host -Prompt "Balls..."
|
|
||||||
|
|
||||||
if ($CompType -like "WKS") {
|
|
||||||
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
|
|
||||||
# Domain credentials to join WKS to domain
|
|
||||||
$MDTPath = $Global:TSEnv.Value("DeployRoot")
|
|
||||||
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
|
||||||
|
|
||||||
Write-Host "Auto-detecting computer name $CompName..."
|
|
||||||
# Filter out OUs
|
|
||||||
if ($PCNamePrefix -like "XH") {
|
|
||||||
Write-Host "Detected computer name as XH - domain joining to Personal WKS OU"
|
|
||||||
$DomainOU = "OU=Personal,OU=Workstations,DC=technolog,DC=net"
|
|
||||||
}
|
|
||||||
elseif ($PCNamePrefix -like "TNG" -or $PCNamePrefix -like "NH" -or $PCNamePrefix -like "IR") {
|
|
||||||
Write-Host "Detected computer name as TNG, NH, or IR - domain joining to Standard WKS OU"
|
|
||||||
$DomainOU = "OU=Workstations,DC=technolog,DC=net"
|
|
||||||
}
|
|
||||||
elseif ($PCNamePrefix -like "TEST") {
|
|
||||||
Write-Host "Detected computer name as TEST - domain joining to Testing WKS OU"
|
|
||||||
$DomainOU = "OU=TestingWKS,OU=Workstations,DC=technolog,DC=net"
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Computer name is unusual - domain joining to Standard WKS OU"
|
|
||||||
$DomainOU = "OU=Workstations,DC=technolog,DC=net"
|
|
||||||
}
|
|
||||||
} elseif ($CompType -like "Server") {
|
|
||||||
$DomainCredential = Get-Credential -Message "To join this server to the domain, enter your domain credentials."
|
|
||||||
# Filter out SubType var for server tiers
|
|
||||||
if ($SubType -ne $null) {
|
|
||||||
$DomainOU = "OU=$SubType,OU=Domain Servers,DC=technolog,DC=net"
|
|
||||||
} else {
|
} else {
|
||||||
$DomainOU = "OU=Domain Servers,DC=technolog,DC=net"
|
write-host "Not part of the domain yet (or joined to another)!"
|
||||||
}
|
return false
|
||||||
} elseif ($CompType -like "Utility") {
|
|
||||||
. "z:\_Scripts\Credentials-MDTJoinDomain.ps1"
|
|
||||||
|
|
||||||
Write-Host "Domain joining to Utility OU"
|
|
||||||
$DomainOU = "OU=Utility,DC=technolog,DC=net"
|
|
||||||
} else {
|
|
||||||
. "z:\_Scripts\Credentials-MDTJoinDomain.ps1"
|
|
||||||
Write-Host "Domain joining to generic Computers OU"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ([boolean](get-variable "DomainOU" -ErrorAction SilentlyContinue)) {
|
|
||||||
try {
|
|
||||||
Add-Computer -DomainName technolog.net -Credential $DomainCredential -OUPath $DomainOU -Restart
|
|
||||||
} catch {
|
|
||||||
Write-Host "Couldn't join the domain with OU $DomainOU"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
try {
|
|
||||||
Add-Computer -DomainName technolog.net -Credential $DomainCredential -Restart
|
|
||||||
} catch {
|
|
||||||
Write-Host "Couldn't join the domain!"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function FilterComputerOU {
|
||||||
|
if ($CompType -like "WKS") {
|
||||||
|
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\LSA" -Name NetJoinLegacyAccountReuse -Value 1
|
||||||
|
$PCNamePrefix = ($CompName.Substring(0,$CompName.IndexOf("-")))
|
||||||
|
# Domain credentials to join WKS to domain
|
||||||
|
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
||||||
|
|
||||||
|
Write-Host "Auto-detecting computer name $CompName..."
|
||||||
|
# Filter out OUs
|
||||||
|
if ($PCNamePrefix -like "XH") {
|
||||||
|
Write-Host "Detected computer name as XH - domain joining to Personal WKS OU"
|
||||||
|
$Script.DomainOU = "OU=Personal,OU=Workstations,DC=technolog,DC=net"
|
||||||
|
}
|
||||||
|
elseif ($PCNamePrefix -like "TNG" -or $PCNamePrefix -like "NH" -or $PCNamePrefix -like "IR") {
|
||||||
|
Write-Host "Detected computer name as TNG, NH, or IR - domain joining to Standard WKS OU"
|
||||||
|
$Script.DomainOU = "OU=Generic,OU=Workstations,DC=technolog,DC=net"
|
||||||
|
} elseif ($PCNamePrefix -like "TEST") {
|
||||||
|
Write-Host "Detected computer name as TEST - domain joining to Testing WKS OU"
|
||||||
|
$Script.DomainOU = "OU=TestingWKS,OU=Workstations,DC=technolog,DC=net"
|
||||||
|
} else {
|
||||||
|
Write-Host "Computer name is unusual - domain joining to Standard WKS OU"
|
||||||
|
$Script.DomainOU = "OU=Workstations,DC=technolog,DC=net"
|
||||||
|
}
|
||||||
|
} elseif ($CompType -like "Server") {
|
||||||
|
$DomainCredential = Get-Credential -Message "To join this server to the domain, enter your domain credentials."
|
||||||
|
# Filter out SubType var for server tiers
|
||||||
|
if ($null -ne $SubType) {
|
||||||
|
$Script.DomainOU = "OU=$SubType,OU=Domain Servers,DC=technolog,DC=net"
|
||||||
|
} else {
|
||||||
|
$Script.DomainOU = "OU=Domain Servers,DC=technolog,DC=net"
|
||||||
|
}
|
||||||
|
} elseif ($CompType -like "Utility") {
|
||||||
|
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
||||||
|
|
||||||
|
Write-Host "Domain joining to Utility OU"
|
||||||
|
$Script.DomainOU = "OU=Utility,OU=Workstations,DC=technolog,DC=net"
|
||||||
|
} else {
|
||||||
|
. "$MDTPath\_Scripts\Credentials-MDTJoinDomain.ps1"
|
||||||
|
Write-Host "Domain joining to generic Computers OU"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Function JoinDomainOU {
|
||||||
|
# Perform domain join with filtered OU from above
|
||||||
|
if ([boolean](get-variable "DomainOU" -ErrorAction SilentlyContinue)) {
|
||||||
|
try {
|
||||||
|
Add-Computer -DomainName technolog.net -Credential $DomainCredential -OUPath $DomainOU -Restart
|
||||||
|
} catch {
|
||||||
|
Write-Host "Couldn't join the domain with OU $DomainOU"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Add-Computer -DomainName technolog.net -Credential $DomainCredential -Restart
|
||||||
|
} catch {
|
||||||
|
Write-Host "Couldn't join the domain!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((CheckDomainJoin) -eq $false) {
|
||||||
|
FilterComputerOU
|
||||||
|
JoinDomainOU
|
||||||
|
}
|
||||||
Stop-Transcript
|
Stop-Transcript
|
@@ -24,6 +24,10 @@ Function Check-VCLibs {
|
|||||||
if ((Get-AppxPackage).Name -like "Microsoft.VCLibs.140.00.UWPDesktop" ) {return $true} else {return $false}
|
if ((Get-AppxPackage).Name -like "Microsoft.VCLibs.140.00.UWPDesktop" ) {return $true} else {return $false}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Check-MSXaml {
|
||||||
|
if ((Get-AppxPackage).Name -like "Microsoft.UI.Xaml*" ) {return $true} else {return $false}
|
||||||
|
}
|
||||||
|
|
||||||
Function Install-VCLibs {
|
Function Install-VCLibs {
|
||||||
if (Check-VCLibs) {
|
if (Check-VCLibs) {
|
||||||
Write-Output "VCLibs.UWPDesktop is already installed."
|
Write-Output "VCLibs.UWPDesktop is already installed."
|
||||||
@@ -38,6 +42,22 @@ Function Install-VCLibs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Install-MSXaml {
|
||||||
|
if (Check-MSXaml) {
|
||||||
|
Write-Output "Microsoft.UI.Xaml is already installed."
|
||||||
|
} else {
|
||||||
|
cmd.exe /c "curl -L -o c:\irnh\msuixaml.zip https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml"
|
||||||
|
try {
|
||||||
|
Expand-Archive c:\irnh\msuixaml.zip
|
||||||
|
Add-AppPackage .\msuixaml\tools\AppX\x64\Release\*.appx
|
||||||
|
Write-Output "Microsoft.UI.Xaml was installed."
|
||||||
|
} catch {
|
||||||
|
Write-Output "Microsoft.UI.Xaml could not be installed."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Function Install-WinGet {
|
Function Install-WinGet {
|
||||||
Write-Host "Checking latest version..."
|
Write-Host "Checking latest version..."
|
||||||
$WGLatestVer = (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).tag_name
|
$WGLatestVer = (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).tag_name
|
||||||
@@ -47,7 +67,7 @@ Function Install-WinGet {
|
|||||||
Write-Output "Domain Controllers has the latest version $WGDomainVer; using that."
|
Write-Output "Domain Controllers has the latest version $WGDomainVer; using that."
|
||||||
try {
|
try {
|
||||||
Add-AppxPackage -Path "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle"
|
Add-AppxPackage -Path "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle"
|
||||||
Add-AppxProvisionedPackage -Online -PackagePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle" -LicensePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\wingetlic.xml"
|
Add-AppxProvisionedPackage -Online -PackagePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\winget.msixbundle" -LicensePath "\\technolog.net\SYSVOL\technolog.net\SoftwareDeploy\wingetlic.xml" -Verbose
|
||||||
Write-Output "WinGet was successfully installed."
|
Write-Output "WinGet was successfully installed."
|
||||||
} catch {
|
} catch {
|
||||||
Write-Output "WinGet could not be installed."
|
Write-Output "WinGet could not be installed."
|
||||||
@@ -56,17 +76,21 @@ Function Install-WinGet {
|
|||||||
else {
|
else {
|
||||||
# If the version we have on our domain controllers is NOT the latest, we have to get it online.
|
# If the version we have on our domain controllers is NOT the latest, we have to get it online.
|
||||||
Write-Host "Internet has the latest copy; downloading WinGet from Microsoft."
|
Write-Host "Internet has the latest copy; downloading WinGet from Microsoft."
|
||||||
cmd.exe /c "curl -L -o c:\irnh\winget.msixbundle https://aka.ms/getwinget" # I hate IWR. lol
|
# download latest files
|
||||||
# download latest lic file
|
|
||||||
foreach ($url in (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url){
|
foreach ($url in (irm https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url){
|
||||||
if ($url -like "*.xml")
|
if ($url -like "*.xml")
|
||||||
{cmd.exe /c "curl -L -o c:\irnh\wingetlic.xml $url"} # I hate IWR. lol
|
{cmd.exe /c "curl -L -o c:\irnh\wingetlic.xml $url"} # I hate IWR. lol
|
||||||
|
if ($url -like "*.msixbundle")
|
||||||
|
{cmd.exe /c "curl -L -o c:\irnh\winget.msixbundle $url"} # I hate IWR. lol
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
# Add-AppxPackage -Path "c:\irnh\winget.msixbundle"
|
# Add-AppxPackage -Path "c:\irnh\winget.msixbundle"
|
||||||
Add-AppxPackage -Path "c:\irnh\winget.msixbundle"
|
Add-AppxPackage -Path "c:\irnh\winget.msixbundle" -Verbose
|
||||||
Add-AppxProvisionedPackage -Online -PackagePath "c:\irnh\winget.msixbundle" -LicensePath "c:\irnh\wingetlic.xml"
|
Add-AppxProvisionedPackage -Online -PackagePath "c:\irnh\winget.msixbundle" -LicensePath "c:\irnh\wingetlic.xml" -Verbose
|
||||||
Write-Output "WinGet was successfully installed."
|
$winget = winget -v
|
||||||
|
if ($winget) {
|
||||||
|
Write-Output "WinGet was successfully installed."
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
Write-Output "WinGet could not be installed."
|
Write-Output "WinGet could not be installed."
|
||||||
}
|
}
|
||||||
@@ -77,6 +101,7 @@ Function Install-WinGet {
|
|||||||
|
|
||||||
if (!(Check-WinGet-Install)) {
|
if (!(Check-WinGet-Install)) {
|
||||||
Install-VCLibs
|
Install-VCLibs
|
||||||
|
Install-MSXaml
|
||||||
Install-WinGet
|
Install-WinGet
|
||||||
}
|
}
|
||||||
Stop-Transcript
|
Stop-Transcript
|
Reference in New Issue
Block a user