Windows Admin Center - Installing extensions using PowerShell
2 min read · Updated 28 October 2022
Hello,
I find it quite time-consuming to have to install Windows Admin Center extensions from the interface and PowerShell does it easily.
I use this script when demonstrating Windows Admin Center; it allows me to add a list of extensions quickly.
# WAC server name.$ServerName = 'srv1'
# Import the WAC module (present on the workstation with WAC).# This may require remote Powershell# Enter-PSSession -ComputerName $ServerNameImport-Module "$env:ProgramFiles\windows admin center\PowerShell\Modules\ExtensionTools"
# WAC address$WAC = "https://$ServerName/"
# List of extensions (to be adapted to your needs)$extensions = 'microsoft.security','msft.iis.iis-management','msft.sme.active-directory','msft.sme.cluster-creation','msft.sme.containers','msft.sme.dhcp','msft.sme.dns','msft.sme.failover-cluster','msft.sme.file-explorer','msft.sme.hyperv','msft.sme.software-defined-data-center','msft.sme.storage-migration','msft.sme.storage-replica','msft.sme.system-insights','msft.sme.windows-update','msft.sdn.acls','msft.sdn.logical-network','msft.sdn.vgw-network-connection','msft.sme.apps-and-features','msft.sme.certificate-manager','msft.sme.dev-guide','msft.sme.device-manager','msft.sme.event-viewer','msft.sme.firewall','msft.sme.local-users-groups','msft.sme.monitor','msft.sme.network-controller','msft.sme.network-settings','msft.sme.packetmon','msft.sme.powershell-console','msft.sme.process-viewer','msft.sme.registry-editor','msft.sme.remote-desktop','msft.sme.roles-features','msft.sme.scheduled-tasks','msft.sme.sdn-monitoring','msft.sme.service-viewer','msft.sme.server-manager','msft.sme.storage'
# List the extensions (the ID is the value to be reused to add your extension to my code)Get-Extension $WAC | Select-Object -Property id, description
# List uninstalled extensionsGet-Extension $WAC | Where-Object {$_.status -eq 'Available' } | Select-Object -Property id, description# Note: Partially functional, old versions of modules are sometimes listed here# Example: msft.sme.hyperv version 2.59.0 is listed as 'Available' even though I have version 2.65 installed.
# Install extensions# Note that I don't bother to check whether the extensions are installed# As the list of uninstalled/installed extensions doesn't seem reliable, I'll let the installation do the thinking for me$extensions | ForEach-Object -Process { Install-Extension -GatewayEndpoint $wac -ExtensionId $_ }Related links
- PowerShell
PowerShell - Simply send objects to different variables
PowerShell - Tip - Simply send objects to different variables
1 min read
- PowerShell
Windows Admin Center - Updating extensions with PowerShell
The Windows Admin Center extensions should update automatically but this obviously doesn't work properly for me, so I use a PowerShell script which is also used in my training courses for WAC demonstrations
1 min read
- PowerShell
Improving the usability of PowerShell on the command line with PSReadLine
The PSReadLine PowerShell module replaces the command line experience for PowerShell 3 and above
1 min read
- PowerShell
Viewing other types of file containing simple text in Windows
It is possible to view other types of file containing simple text, such as .ps1, .psm1, .psd1, .twig, .gcode... in Windows File Explorer
1 min read
- PowerShell
PowerShell - Testing network connectivity and port accessibility
Testing network connectivity and port accessibility with PowerShell
2 min read
- PowerShell
PowerShell - Display network connections (equivalent to netstat)
Display network connections (listening ports, active connections...)
2 min read