├── .gitattributes ├── LICENSE ├── PSWindowsAdminCenter ├── PSWindowsAdminCenter.psd1 ├── PSWindowsAdminCenter.psm1 ├── Private │ └── Get-RequestParameter.ps1 └── Public │ ├── Add-WacConnection.ps1 │ ├── Add-WacFeed.ps1 │ ├── Get-WacConnection.ps1 │ ├── Get-WacExtension.ps1 │ ├── Get-WacFeed.ps1 │ ├── Install-WacExtension.ps1 │ ├── Remove-WacConnection.ps1 │ ├── Remove-WacFeed.ps1 │ ├── Uninstall-WacExtension.ps1 │ └── Update-WacExtension.ps1 ├── README.md ├── Tests └── Unit │ └── Get-WacConnection.Tests.ps1 ├── azure-pipelines.yml ├── build.ps1 └── docs ├── Add-WacConnection.md ├── Add-WacFeed.md ├── Get-WacConnection.md ├── Get-WacExtension.md ├── Get-WacFeed.md ├── Install-WacExtension.md ├── Remove-WacFeed.md ├── Uninstall-WacExtension.md ├── Update-WacExtension.md └── index.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 rchaganti 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /PSWindowsAdminCenter/PSWindowsAdminCenter.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rchaganti/PSWindowsAdminCenter/05f70dfdf9dc59d84ccc4ce6c623939fb27682b9/PSWindowsAdminCenter/PSWindowsAdminCenter.psd1 -------------------------------------------------------------------------------- /PSWindowsAdminCenter/PSWindowsAdminCenter.psm1: -------------------------------------------------------------------------------- 1 | Add-Type @" 2 | using System.Net; 3 | using System.Security.Cryptography.X509Certificates; 4 | public class TrustAllCertsPolicy : ICertificatePolicy { 5 | public bool CheckValidationResult( 6 | ServicePoint srvPoint, X509Certificate certificate, 7 | WebRequest request, int certificateProblem) { 8 | return true; 9 | } 10 | } 11 | "@ 12 | 13 | [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy 14 | 15 | $allProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12' 16 | [System.Net.ServicePointManager]::SecurityProtocol = $allProtocols 17 | 18 | #Get public and private function definition files. 19 | $public = @( Get-ChildItem -Path $PSScriptRoot\Public\ -Filter *.ps1 -Exclude *.Tests.ps1 -Recurse -ErrorAction SilentlyContinue ) 20 | $private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -Exclude *.Tests.ps1 -ErrorAction SilentlyContinue ) 21 | 22 | #Dot source the files 23 | foreach($import in @($public + $private)) 24 | { 25 | try 26 | { 27 | . $import.fullname 28 | } 29 | catch 30 | { 31 | Write-Error -Message "Failed to import function $($import.fullname): $_" 32 | } 33 | } 34 | 35 | #Export only the functions in public scripts 36 | Export-ModuleMember -Function $Public.Basename -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Private/Get-RequestParameter.ps1: -------------------------------------------------------------------------------- 1 | function Get-RequestParameter 2 | { 3 | [CmdletBinding()] 4 | [OutputType([System.Collections.Hashtable])] 5 | param 6 | ( 7 | [Parameter(Mandatory = $true)] 8 | [String] 9 | $GatewayEndpoint, 10 | 11 | [Parameter()] 12 | [pscredential] 13 | $Credential, 14 | 15 | [Parameter(Mandatory = $true)] 16 | [String] 17 | $ApiEndpoint, 18 | 19 | [Parameter(Mandatory = $true)] 20 | [String] 21 | $Method 22 | ) 23 | 24 | $requestUri = [Uri]"${GatewayEndpoint}${ApiEndpoint}" 25 | 26 | $parameters = @{ 27 | UseBasicParsing = $true 28 | UserAgent = 'PowerShell' 29 | Uri = $requestUri.OriginalString 30 | Method = $Method 31 | } 32 | 33 | if ($requestUri.Host -eq 'localhost') 34 | { 35 | $certThumbprint = (Get-ItemProperty "HKLM:\Software\Microsoft\ServerManagementGateway").ClientCertificateThumbprint 36 | if ($certThumbprint) 37 | { 38 | $parameters.certificateThumbprint = "$certThumbprint" 39 | } 40 | } 41 | 42 | if ($Credential) { 43 | $parameters.credential = $Credential 44 | } 45 | else { 46 | $parameters.useDefaultCredentials = $True 47 | } 48 | 49 | return $parameters 50 | } 51 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Add-WacConnection.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | #> 4 | function Add-WacConnection 5 | { 6 | [CmdletBinding()] 7 | param 8 | ( 9 | [Parameter(Mandatory = $true)] 10 | [String] 11 | $GatewayEndpoint, 12 | 13 | [Parameter(Mandatory = $true)] 14 | [String] 15 | $ConnectionName, 16 | 17 | [Parameter(Mandatory = $true)] 18 | [ValidateSet('msft.sme.connection-type.server','msft.sme.connection-type.cluster','msft.sme.connection-type.hyper-converged-cluster','msft.sme.connection-type.windows-client')] 19 | [String] 20 | $ConnectionType, 21 | 22 | [Parameter()] 23 | [String[]] 24 | $Tags, 25 | 26 | [Parameter()] 27 | [PSCredential] 28 | $Credential, 29 | 30 | [Parameter()] 31 | [Switch] 32 | $SharedConnection 33 | ) 34 | 35 | $params = @{ 36 | GatewayEndpoint = $GatewayEndpoint 37 | } 38 | 39 | if ($Credential) 40 | { 41 | $params.Add('Credential',$Credential) 42 | } 43 | 44 | Write-Verbose -Message 'Retrieving existig connections in WAC ...' 45 | $existingConections = [PSCustomObject[]](Get-WacConnection @params) 46 | if ($existingConections.Where({$_.Type -eq $ConnectionType}).Name -contains $ConnectionName) 47 | { 48 | throw "$ConnectionName of type $ConnectionType already exists in WAC" 49 | } 50 | 51 | $params.Add('APIEndpoint', '/api/connections') 52 | $params.Add('Method','Put') 53 | 54 | Write-Verbose -Message 'Generating request parameters ...' 55 | $requestParameters = Get-RequestParameter @params 56 | 57 | $connectionObject = @() 58 | $connectionObject += @{ 59 | name = $ConnectionName 60 | type = $ConnectionType 61 | id = "${ConnectionType}!${ConnectionName}" 62 | tags = $Tags 63 | } 64 | 65 | if ($SharedConnection) 66 | { 67 | Write-Verbose -Message "Adding $ConnectionName as shared connection" 68 | $connectionObject[0].Add('groupId','global') 69 | } 70 | 71 | $requestParameters.Add('Body', '[' + $($connectionObject | ConvertTo-Json) + ']') 72 | 73 | Write-Verbose -Message 'Invoking add WAC connection api ...' 74 | $response = Invoke-WebRequest @requestParameters -ErrorAction SilentlyContinue 75 | 76 | if ($response.StatusCode -eq 200) 77 | { 78 | return ($response.Content | ConvertFrom-Json).Changes 79 | } 80 | else 81 | { 82 | throw "Error adding $ConnectionName of type $ConnectionType" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Add-WacFeed.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | #> 3 | function Add-WacFeed 4 | { 5 | [CmdletBinding()] 6 | param 7 | ( 8 | [Parameter(Mandatory = $true)] 9 | [String] 10 | $GatewayEndpoint, 11 | 12 | [Parameter(Mandatory = $true)] 13 | [String] 14 | $Path, 15 | 16 | [Parameter()] 17 | [PSCredential] 18 | $Credential 19 | ) 20 | 21 | $params = @{ 22 | GatewayEndpoint = $GatewayEndpoint 23 | } 24 | 25 | if ($Credential) 26 | { 27 | $params.Add('Credential', $Credential) 28 | } 29 | 30 | Write-Verbose -Message 'Getting existing WAC feeds ...' 31 | $feeds = Get-WacFeed @params 32 | if ($feeds.Path -Contains $Path) 33 | { 34 | throw "${Path} exists in Windows Admin Center as a feed." 35 | } 36 | else 37 | { 38 | $feedObject = [PSCustomObject]@{ 39 | packageFeeds = $($feeds.Path),$Path 40 | } 41 | } 42 | 43 | $params.Add('APIEndpoint','/api/extensions/configs') 44 | $params.Add('Method','Put') 45 | 46 | Write-Verbose -Message 'Generating request parameters ...' 47 | $requestParameters = Get-RequestParameter @params 48 | $requestParameters.Add('Body', (ConvertTo-Json -InputObject $feedObject)) 49 | 50 | Write-Verbose -Message 'Invoking add WAC feed api ...' 51 | $response = Invoke-WebRequest @requestParameters -ErrorAction SilentlyContinue 52 | 53 | if ($response.StatusCode -ne 200 ) 54 | { 55 | throw "Failed to add the feed in the gateway" 56 | } 57 | else 58 | { 59 | return (Get-WacFeed -GatewayEndpoint $GatewayEndpoint -Credential $Credential) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Get-WacConnection.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | #> 3 | function Get-WacConnection 4 | { 5 | [CmdletBinding()] 6 | param 7 | ( 8 | [Parameter(Mandatory = $true)] 9 | [String] 10 | $GatewayEndpoint, 11 | 12 | [Parameter()] 13 | [String] 14 | $ConnectionName, 15 | 16 | [Parameter()] 17 | [PSCredential] 18 | $Credential 19 | ) 20 | 21 | $params = @{ 22 | GatewayEndpoint = $GatewayEndpoint 23 | Method = 'Get' 24 | APIEndpoint = '/api/connections' 25 | } 26 | 27 | if ($Credential) 28 | { 29 | $params.Add('Credential', $Credential) 30 | } 31 | 32 | Write-Verbose -Message 'Generating request parameters ...' 33 | $requestParameters = Get-RequestParameter @params 34 | 35 | Write-Verbose -Message 'Invoking get WAC connection api ...' 36 | $response = Invoke-WebRequest @requestParameters -ErrorAction SilentlyContinue 37 | if ($response.StatusCode -eq 200) 38 | { 39 | $allConnections = (ConvertFrom-Json -InputObject $response.Content).Value.Properties 40 | 41 | if ($ConnectionName) 42 | { 43 | $connections = $allConnections.Where({$_.Name -eq $ConnectionName}) 44 | } 45 | else 46 | { 47 | $connections = $allConnections 48 | } 49 | 50 | $connectionObject = @() 51 | foreach ($conn in $connections) 52 | { 53 | $connHash = [PSCustomObject] @{} 54 | $connHash | Add-Member -MemberType NoteProperty -Name Name -Value $conn.name 55 | $connHash | Add-Member -MemberType NoteProperty -Name id -Value $conn.id 56 | $connHash | Add-Member -MemberType NoteProperty -Name type -Value $conn.type 57 | $connHash | Add-Member -MemberType NoteProperty -Name tags -Value $conn.tags 58 | 59 | foreach ($property in $conn.properties.psobject.Properties) 60 | { 61 | $propertyName = $property.Name 62 | $connHash | Add-Member -MemberType NoteProperty -Name $propertyName -Value $conn.properties.$propertyName 63 | } 64 | 65 | if ($conn.groupId -and ($conn.groupId -eq 'global')) 66 | { 67 | $connHash | Add-Member -MemberType NoteProperty -Name IsSharedConnection -Value $true 68 | } 69 | else 70 | { 71 | $connHash | Add-Member -MemberType NoteProperty -Name IsSharedConnection -Value $false 72 | } 73 | 74 | $connectionObject += $connHash 75 | } 76 | 77 | return $connectionObject 78 | } 79 | else 80 | { 81 | throw 'Failed invoking get WAC connection api ...' 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Get-WacExtension.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | #> 3 | Function Get-WacExtension 4 | { 5 | [CmdletBinding()] 6 | param 7 | ( 8 | [Parameter(Mandatory = $true)] 9 | [String] 10 | $GatewayEndpoint, 11 | 12 | [Parameter()] 13 | [String] 14 | $ExtensionId, 15 | 16 | [Parameter()] 17 | [PSCredential] 18 | $Credential, 19 | 20 | [Parameter()] 21 | [ValidateSet('Installed','Available','All')] 22 | [String] 23 | $Status = 'All' 24 | ) 25 | 26 | $params = @{ 27 | GatewayEndpoint = $GatewayEndpoint 28 | APIEndpoint = '/api/extensions' 29 | Method = 'Get' 30 | } 31 | 32 | if ($Credential) 33 | { 34 | $params.Add('Credential',$Credential) 35 | } 36 | 37 | Write-Verbose -Message 'Generating request parameters ...' 38 | $requestParameters = Get-RequestParameter @params 39 | 40 | Write-Verbose -Message 'Invoking get WAC extension api ...' 41 | $response = Invoke-WebRequest @requestParameters -ErrorAction SilentlyContinue 42 | 43 | if ($response.StatusCode -eq 200) 44 | { 45 | $extensions = (ConvertFrom-Json -InputObject $response.Content).Values 46 | 47 | $extensionObject = @() 48 | foreach ($extension in $extensions) 49 | { 50 | $extensionHash = [PSCustomObject]@{} 51 | foreach ($property in $extension.psobject.properties) 52 | { 53 | $propertyName = $property.Name 54 | $extensionHash | Add-Member -MemberType NoteProperty -Name $propertyName -Value $extension.$propertyName 55 | } 56 | 57 | $extensionObject += $extensionHash 58 | } 59 | 60 | if ($Status -ne 'All') 61 | { 62 | $extensions = $extensionObject.Where({$_.Status -eq $Status}) 63 | } 64 | else 65 | { 66 | $extensions = $extensionObject 67 | } 68 | 69 | if ($ExtensionId) 70 | { 71 | return ($extensions | Where-Object { $_.id -eq $ExtensionId }) 72 | } 73 | else 74 | { 75 | return $extensions 76 | } 77 | } 78 | else 79 | { 80 | throw 'Error invoking get WAC extension api ...' 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Get-WacFeed.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | #> 3 | Function Get-WacFeed 4 | { 5 | [CmdletBinding()] 6 | param 7 | ( 8 | [Parameter(Mandatory = $true)] 9 | [String] 10 | $GatewayEndpoint, 11 | 12 | [Parameter()] 13 | [PSCredential] 14 | $Credential 15 | ) 16 | 17 | $params = @{ 18 | GatewayEndpoint = $GatewayEndpoint 19 | APIEndpoint = '/api/extensions/configs' 20 | Method = 'Get' 21 | } 22 | 23 | if ($Credential) 24 | { 25 | $params.Add('Credential',$Credential) 26 | } 27 | 28 | Write-Verbose -Message 'Generating request parameters ...' 29 | $requestParameters = Get-RequestParameter @params 30 | 31 | Write-Verbose -Message 'Invoking get WAC feed api ...' 32 | $response = Invoke-WebRequest @requestParameters -ErrorAction SilentlyContinue 33 | if ($response.StatusCode -eq 200) 34 | { 35 | $feeds = ConvertFrom-Json -InputObject $response.Content 36 | 37 | $feedObject = @() 38 | foreach ($feed in $feeds.packageFeeds) 39 | { 40 | $feedHash = [PsCustomObject]@{ 41 | Path = $feed 42 | } 43 | 44 | $feedObject += $feedHash 45 | } 46 | 47 | return $feedObject 48 | } 49 | else 50 | { 51 | throw 'Error invoking get WAC feed api ...' 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Install-WacExtension.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | #> 3 | Function Install-WacExtension 4 | { 5 | [CmdletBinding()] 6 | param 7 | ( 8 | [Parameter(Mandatory = $true)] 9 | [String] 10 | $GatewayEndpoint, 11 | 12 | [Parameter(Mandatory = $true)] 13 | [String] 14 | $ExtensionId, 15 | 16 | [Parameter()] 17 | [PSCredential] 18 | $Credential, 19 | 20 | [Parameter()] 21 | [String] 22 | $Version 23 | ) 24 | 25 | # Check if extension is in the available list 26 | Write-Verbose -Message 'Getting available WAC extensions ...' 27 | $extension = Get-WacExtension -GatewayEndpoint $GatewayEndpoint -Status Available -ExtensionId $ExtensionId | Select-Object id, @{l='version';e={[System.Version]$_.version}} | Sort-Object -Property Version 28 | 29 | if ($extension) 30 | { 31 | #If version is specified check if it exists in the available extension list 32 | if ($Version) 33 | { 34 | if ($extension.version -contains $Version) 35 | { 36 | $extensionVersion = $Version 37 | } 38 | else 39 | { 40 | throw "${extensionId} with specified version ${version} is not available for install" 41 | } 42 | } 43 | else 44 | { 45 | #if version is not specified, get the most recent version from the available list 46 | $extensionVersion = $extension[0].version.ToString() 47 | } 48 | 49 | $params = @{ 50 | GatewayEndpoint = $GatewayEndpoint 51 | APIEndpoint = "/api/extensions/$($extensionId)/versions/$($extensionVersion)/install" 52 | Method = 'Post' 53 | } 54 | 55 | if ($Credential) 56 | { 57 | $params.Add('Credential',$Credential) 58 | } 59 | 60 | Write-Verbose -Message 'Generating request parameters ...' 61 | $requestParameters = Get-RequestParameter @params 62 | 63 | Write-Verbose -Message 'Invoking install WAC extension api ...' 64 | $response = Invoke-WebRequest @requestParameters 65 | if ($response.StatusCode -eq 200) 66 | { 67 | $getParams = @{ 68 | GatewayEndpoint = $GatewayEndpoint 69 | extensionId = $ExtensionId 70 | Status = 'Installed' 71 | } 72 | 73 | if ($Credential) 74 | { 75 | $getParams.Add('Credential', $Credential) 76 | } 77 | 78 | return (Get-WacExtension @getParams) 79 | } 80 | else 81 | { 82 | throw 'Error invoking install WAC extension api ...' 83 | } 84 | } 85 | else 86 | { 87 | throw ("{0} is not available for install" -f $ExtensionId) 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Remove-WacConnection.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | #> 4 | function Remove-WacConnection 5 | { 6 | [CmdletBinding()] 7 | param 8 | ( 9 | [Parameter(Mandatory = $true)] 10 | [String] 11 | $GatewayEndpoint, 12 | 13 | [Parameter(Mandatory = $true)] 14 | [String] 15 | $ConnectionName, 16 | 17 | [Parameter(Mandatory = $true)] 18 | [ValidateSet('msft.sme.connection-type.server','msft.sme.connection-type.cluster','msft.sme.connection-type.hyper-converged-cluster','msft.sme.connection-type.windows-client')] 19 | [String] 20 | $ConnectionType, 21 | 22 | [Parameter()] 23 | [PSCredential] 24 | $Credential 25 | ) 26 | 27 | $params = @{ 28 | GatewayEndpoint = $GatewayEndpoint 29 | } 30 | 31 | if ($Credential) 32 | { 33 | $params.Add('Credential',$Credential) 34 | } 35 | 36 | Write-Verbose -Message 'Retrieving existig connections in WAC ...' 37 | $existingConections = [PSCustomObject[]](Get-WacConnection @params) 38 | $desiredConnection = $existingConections.Where({($_.Type -eq $ConnectionType) -and ($_.Name -eq $ConnectionName)}) 39 | 40 | if (-not $desiredConnection) 41 | { 42 | throw "$ConnectionName of type $ConnectionType does not exist in WAC" 43 | } 44 | 45 | if ($desiredConnection.IsSharedConnection) 46 | { 47 | Write-Verbose -Message "$ConnectionName is a shared connection" 48 | $apiEndpoint = "/api/connections/${connectionType}!${connectionName}!global" 49 | } 50 | else 51 | { 52 | $apiEndpoint = "/api/connections/${connectionType}!${connectionName}" 53 | } 54 | 55 | $params.Add('APIEndpoint', $apiEndpoint) 56 | $params.Add('Method', 'Delete') 57 | 58 | Write-Verbose -Message 'Generating request parameters ...' 59 | $requestParameters = Get-RequestParameter @params 60 | 61 | Write-Verbose -Message 'Invoking remove WAC connection api ...' 62 | $response = Invoke-WebRequest @requestParameters -ErrorAction SilentlyContinue 63 | 64 | if (-not ($response.StatusCode -eq 204)) 65 | { 66 | throw "Error removing $ConnectionName of type $ConnectionType" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Remove-WacFeed.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | #> 4 | Function Remove-WacFeed 5 | { 6 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] 7 | param 8 | ( 9 | [Parameter(Mandatory = $true)] 10 | [String] 11 | $GatewayEndpoint, 12 | 13 | [Parameter(Mandatory = $true)] 14 | [String] 15 | $Path, 16 | 17 | [Parameter()] 18 | [PSCredential] 19 | $Credential 20 | ) 21 | 22 | if ($PSCmdlet.ShouldProcess("Remove WAC feed $Path?")) 23 | { 24 | $params = @{ 25 | GatewayEndpoint = $GatewayEndpoint 26 | } 27 | 28 | if ($Credential) 29 | { 30 | $params.Add('Credential', $Credential) 31 | } 32 | 33 | Write-Verbose -Message 'Getting existing WAC feeds ...' 34 | $feeds = Get-WacFeed @params 35 | 36 | if ($feeds.Path -notcontains $Path) 37 | { 38 | throw "${Path} does not exist in Windows Admin Center as a feed." 39 | } 40 | else 41 | { 42 | $feedObject = [PSCustomObject]@{ 43 | packageFeeds = @($feeds.Path | Where-Object { $_ -ne $Path }) 44 | } 45 | } 46 | 47 | $params.Add('APIEndpoint', '/api/extensions/configs') 48 | $params.Add('Method','Put') 49 | 50 | Write-Verbose -Message 'Generating request parameters ...' 51 | $requestParameters = Get-RequestParameter @params 52 | $requestParameters.Add('Body', (ConvertTo-Json -InputObject $feedObject)) 53 | 54 | Write-Verbose -Message 'Invoking remove WAC feed api ...' 55 | $response = Invoke-WebRequest @requestParameters -ErrorAction Stop 56 | if ($response.StatusCode -ne 200 ) 57 | { 58 | throw "Failed to remove the feed from the gateway" 59 | } 60 | else 61 | { 62 | return (Get-WacFeed -GatewayEndpoint $GatewayEndpoint -Credential $Credential) 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Uninstall-WacExtension.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | #> 4 | Function Uninstall-WacExtension 5 | { 6 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] 7 | param 8 | ( 9 | [Parameter(Mandatory = $true)] 10 | [String] 11 | $GatewayEndpoint, 12 | 13 | [Parameter(Mandatory = $true)] 14 | [String] 15 | $ExtensionId, 16 | 17 | [Parameter()] 18 | [String] 19 | $Version, 20 | 21 | [Parameter()] 22 | [PSCredential] 23 | $Credential 24 | ) 25 | 26 | if ($PSCmdlet.ShouldProcess("Uninstall WAC extension ${extensionId}?")) 27 | { 28 | # Check if extension is in the installed list 29 | Write-Verbose -Message 'Getting installed WAC extensions ...' 30 | $extension = Get-WacExtension -GatewayEndpoint $GatewayEndpoint -Status Installed -ExtensionId $ExtensionId | Select-Object id, @{l='version';e={[System.Version]$_.version}} | Sort-Object -Property Version 31 | 32 | if ($extension) 33 | { 34 | #If version is specified check if it exists in the installed extension list 35 | if ($Version) 36 | { 37 | if ($extension.version -contains $Version) 38 | { 39 | $extensionVersion = $Version 40 | } 41 | else 42 | { 43 | throw "${extensionId} with specified version ${version} is not installed" 44 | } 45 | } 46 | else 47 | { 48 | #if version is not specified, get the most recent version from the available list 49 | $extensionVersion = $extension[0].version.toString() 50 | } 51 | 52 | $params = @{ 53 | GatewayEndpoint = $GatewayEndpoint 54 | APIEndpoint = "/api/extensions/$($extensionId)/versions/$($extensionVersion)/uninstall" 55 | Method = 'Post' 56 | } 57 | 58 | if ($Credential) 59 | { 60 | $params.Add('Credential',$Credential) 61 | } 62 | 63 | Write-Verbose -Message 'Generating request parameters ...' 64 | $requestParameters = Get-RequestParameter @params 65 | 66 | Write-Verbose -Message 'Invoking uninstall WAC extension api ...' 67 | $response = Invoke-WebRequest @requestParameters 68 | 69 | if ($response.StatusCode -eq 200) 70 | { 71 | $getParams = @{ 72 | GatewayEndpoint = $GatewayEndpoint 73 | extensionId = $ExtensionId 74 | Status = 'Available' 75 | } 76 | 77 | if ($Credential) 78 | { 79 | $getParams.Add('Credential', $Credential) 80 | } 81 | 82 | return (Get-WacExtension @getParams) 83 | } 84 | else 85 | { 86 | throw 'Error invoking install WAC extension api ...' 87 | } 88 | } 89 | else 90 | { 91 | throw ("{0} is not installed" -f $ExtensionId) 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /PSWindowsAdminCenter/Public/Update-WacExtension.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | #> 4 | Function Update-WacExtension 5 | { 6 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] 7 | param 8 | ( 9 | [Parameter(Mandatory = $true)] 10 | [String] 11 | $GatewayEndpoint, 12 | 13 | [Parameter(Mandatory = $true)] 14 | [String] 15 | $ExtensionId, 16 | 17 | [Parameter()] 18 | [PSCredential] 19 | $Credential 20 | ) 21 | 22 | if ($PSCmdlet.ShouldProcess("Update WAC Extension ${ExtensionId}?")) 23 | { 24 | # Check if extension is in the installed list 25 | Write-Verbose -Message 'Getting installed WAC extensions ...' 26 | $extension = Get-WacExtension -GatewayEndpoint $GatewayEndpoint -Status Installed -ExtensionId $ExtensionId 27 | 28 | if ($extension) 29 | { 30 | $extensionVersion = $extension.version 31 | 32 | $params = @{ 33 | GatewayEndpoint = $GatewayEndpoint 34 | APIEndpoint = "/api/extensions/$($extensionId)/versions/$($extensionVersion)/update" 35 | Method = 'Post' 36 | } 37 | 38 | if ($Credential) 39 | { 40 | $params.Add('Credential',$Credential) 41 | } 42 | 43 | Write-Verbose -Message 'Generating request parameters ...' 44 | $requestParameters = Get-RequestParameter @params 45 | 46 | Write-Verbose -Message 'Invoking update WAC extension api ...' 47 | $response = Invoke-WebRequest @requestParameters 48 | if ($response.StatusCode -eq 200) 49 | { 50 | $getParams = @{ 51 | GatewayEndpoint = $GatewayEndpoint 52 | extensionId = $ExtensionId 53 | Status = 'Installed' 54 | } 55 | 56 | if ($Credential) 57 | { 58 | $getParams.Add('Credential', $Credential) 59 | } 60 | 61 | return (Get-WacExtension @getParams) 62 | } 63 | else 64 | { 65 | throw 'Error invoking install WAC extension api ...' 66 | } 67 | } 68 | else 69 | { 70 | throw ("{0} is not installed" -f $ExtensionId) 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PS Windows Admin Center 2 | 3 | > **Note**: This works with Windows Admin Center 1809.5 and above 4 | 5 | This module contains a set of commands to manage connections, feeds, and extensions in Windows Admin Center. 6 | 7 | This module can be installed from PowerShell Gallery: 8 | 9 | ```powershell 10 | Install-Module -Name PSWindowsAdminCenter 11 | ``` 12 | 13 | | Command | Description | 14 | | ---------------------- | ------------------------------------------------------------ | 15 | | Get-WacConnection | Gets connections added to Windows admin Center for management. This command supports shared connections introduced in 1902 insider preview. | 16 | | Add-WacConnection | Adds a new connection to Windows Admin Center for management. This command supports shared connections introduced in 1902 insider preview. | 17 | | Remove-WacConnection | Removes connection to Windows Admin Center for management. This command supports shared connections introduced in 1902 insider preview. | 18 | | Get-WacFeed | Gets all extension feeds available in Windows Admin Center. | 19 | | Add-WacFeed | Adds an extension feed to Windows Admin Center. | 20 | | Remove-WacFeed | Removes an extension feed from Windows Admin Center. | 21 | | Get-WacExtension | Gets all extensions available or installed in Windows Admin Center. | 22 | | Install-WacExtension | Installs an extension. | 23 | | Uninstall-WacExtension | Uninstalls an extension. | 24 | | Update-WacExtension | Updates an extension. | 25 | 26 | -------------------------------------------------------------------------------- /Tests/Unit/Get-WacConnection.Tests.ps1: -------------------------------------------------------------------------------- 1 | $script:moduleName = 'PSWindowsAdminCenter' 2 | 3 | # Import the PSAdminCenter module 4 | Import-Module $PSScriptRoot\..\..\PSWindowsAdminCenter\PSWindowsAdminCenter.psd1 -Force 5 | 6 | InModuleScope $moduleName { 7 | Describe 'Get-WacConnection Tests' { 8 | BeforeAll { 9 | mock Get-ItemProperty 10 | } 11 | mock -CommandName Invoke-WebRequest -MockWith { 12 | param 13 | ( 14 | [Parameter()] 15 | [Bool] 16 | $UseBasicParsing = $true, 17 | 18 | [Parameter()] 19 | [Bool] 20 | $UseDefaultCredentials = $true, 21 | 22 | [Parameter()] 23 | [String] 24 | $UserAgent = 'PowerShell', 25 | 26 | [Parameter()] 27 | [String] 28 | $Uri, 29 | 30 | [Parameter()] 31 | [string] 32 | $Method 33 | ) 34 | 35 | $content = @{ 36 | Content = @{ 37 | Value = @() 38 | } 39 | } 40 | 41 | return @{ 42 | Content = (ConvertTo-Json -InputObject $content) 43 | StatusCode = 200 44 | } 45 | } -Verifiable 46 | 47 | #Invoke-WebRequest mock 48 | Context 'Get WAC connection with no credentials' { 49 | $inputParams = @{ 50 | GatewayEndpoint = 'https://localhost' 51 | } 52 | 53 | It 'No WAC connections exist' { 54 | $connections = Get-WacConnection @inputParams 55 | $connections | Should BeNullOrEmpty 56 | } 57 | 58 | Assert-VerifiableMock 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - job: Build_PS_Win2016 3 | pool: 4 | vmImage: vs2017-win2016 5 | steps: 6 | - powershell: | 7 | .\build.ps1 -Verbose 8 | displayName: 'Build and Test' 9 | - task: PublishTestResults@2 10 | inputs: 11 | testRunner: 'NUnit' 12 | testResultsFiles: '**/TestResults.xml' 13 | testRunTitle: 'PS_Win2016' 14 | displayName: 'Publish Test Results' 15 | 16 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | Push-Location $PSScriptRoot\Tests 2 | $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru 3 | Pop-Location 4 | -------------------------------------------------------------------------------- /docs/Add-WacConnection.md: -------------------------------------------------------------------------------- 1 | # Add-WacConnection 2 | 3 | This command adds a new connection in Windows Admin Center for management. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | ---------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | ConnectionName | Specifies the name of the server or cluster to be added. This parameter is mandatory. | This needs to be a Fully-Qualifies Domain Name. | 9 | | ConnectionType | Specifies the type of the connection being added. This parameter is mandatory. | 'msft.sme.connection-type.server'
'msft.sme.connection-type.cluster'
'msft.sme.connection-type.hyper-converged-cluster'
msft.sme.connection-type.windows-client | 10 | | Tags | Specifies any tags that need to be attached to the connection in WAC. | | 11 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 12 | | SharedConnection | Specifies that the connection being added is a shared connection | This is a switch parameter. | 13 | 14 | ## Example 1 15 | 16 | ```powershell 17 | Add-WacConnection -GatewayEndpoint https://localhost -ConnectionName ad.my.lab -ConnectionType 'msft.sme.connection-type.server' 18 | ``` 19 | 20 | The above command will add ad.my.lab as a server connection in Windows Admin Center. 21 | 22 | ## Example 2 23 | 24 | ```powershell 25 | Add-WacConnection -GatewayEndpoint https://localhost -ConnectionName cluster.my.lab -ConnectionType 'msft.sme.connection-type.cluster' -Credential (Get-Credential) 26 | ``` 27 | 28 | The above command will add cluster.my.lab as a failover cluster connection in Windows Admin Center. This command uses credentials to authenticate to WAC. 29 | 30 | ## Example 3 31 | 32 | ```powershell 33 | Add-WacConnection -GatewayEndpoint https://localhost -ConnectionName hcicluster.my.lab -ConnectionType 'msft.sme.connection-type.hyper-converged-cluster' -Tags 'hci','s2d' 34 | ``` 35 | 36 | The above command will add hcicluster.my.lab as a Hyper-Converged Infrastructure connection in Windows Admin Center. This command also adds tags along with the connection. 37 | 38 | ## Example 3 39 | 40 | ```powershell 41 | Add-WacConnection -GatewayEndpoint https://localhost -ConnectionName hcicluster.my.lab -ConnectionType 'msft.sme.connection-type.hyper-converged-cluster' -Tags 'hci','s2d' -SharedConnection 42 | ``` 43 | 44 | The above command will add hcicluster.my.lab as a Hyper-Converged Infrastructure shared connection in Windows Admin Center. This command also adds tags along with the connection. -------------------------------------------------------------------------------- /docs/Add-WacFeed.md: -------------------------------------------------------------------------------- 1 | # Add-WacFeed 2 | 3 | This command adds a new extension feed to Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | Path | Specifies the path to a WAC extension feed. This parameter is mandatory. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | 11 | ## Example 1 12 | 13 | ```powershell 14 | Add-WacFeed -GatewayEndpoint https://localhost -Path '\\wac\share' 15 | ``` 16 | 17 | The above command will add \\\wac\share as an extension feed in Windows Admin Center. 18 | 19 | ## Example 2 20 | 21 | ```powershell 22 | Add-WacFeed -GatewayEndpoint https://localhost -Path '\\wac\share' -Credential (Get-Credential) 23 | ``` 24 | 25 | The above command will add \\\wac\share as an extension feed in Windows Admin Center. This command uses credentials to authenticate to WAC. 26 | 27 | -------------------------------------------------------------------------------- /docs/Get-WacConnection.md: -------------------------------------------------------------------------------- 1 | # Get-WacConnection 2 | 3 | This command gets a specified or all connections available in Windows Admin Center for management. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | ConnectionName | Specifies the name of the connection to retrieve. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | 11 | ## Example 1 12 | 13 | ```powershell 14 | Get-WacConnection -GatewayEndpoint https://localhost -ConnectionName ad.my.lab 15 | ``` 16 | 17 | The above command will get details of the ad.my.lab as a server connection from Windows Admin Center. 18 | 19 | ## Example 2 20 | 21 | ```powershell 22 | Get-WacConnection -GatewayEndpoint https://localhost -ConnectionName ad.my.lab -Credential (Get-Credential) 23 | ``` 24 | 25 | The above command will get details of the ad.my.lab as a server connection from Windows Admin Center. This command uses credentials to authenticate to WAC. 26 | 27 | ## Example 3 28 | 29 | ```powershell 30 | Get-WacConnection -GatewayEndpoint https://localhost 31 | ``` 32 | 33 | The above command will get all connections added to WAC for management. -------------------------------------------------------------------------------- /docs/Get-WacExtension.md: -------------------------------------------------------------------------------- 1 | # Get-WacExtension 2 | 3 | This command gets a specified or all (installed or available) extensions available in Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | ExtensionId | Specifies the extension id for which the details needs to be retrieved. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | | Status | Specifies if only installed or available extensions should be retrieved or all. | All
Installed
Available | 11 | 12 | ## Example 1 13 | 14 | ```powershell 15 | Get-WacExtension -GatewayEndpoint https://localhost 16 | ``` 17 | 18 | The above command will all extensions (installed and available) from Windows Admin Center. 19 | 20 | ## Example 2 21 | 22 | ```powershell 23 | Get-WacExtension -GatewayEndpoint https://localhost -Credential (Get-Credential) 24 | ``` 25 | 26 | The above command will all extensions (installed and available) from Windows Admin Center. This command uses credentials to authenticate to WAC. 27 | 28 | ## Example 3 29 | 30 | ```powershell 31 | Get-WacExtension -GatewayEndpoint https://localhost -Status Installed 32 | ``` 33 | 34 | The above command will get only installed extensions. 35 | 36 | ## Example 4 37 | 38 | ```powershell 39 | Get-WacExtension -GatewayEndpoint https://localhost -Status Available 40 | ``` 41 | 42 | The above command will get only available extensions. 43 | 44 | ## Example 5 45 | 46 | Get-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' 47 | 48 | The above command will retrieve details only about the extension with an id ExtensionId. 49 | 50 | -------------------------------------------------------------------------------- /docs/Get-WacFeed.md: -------------------------------------------------------------------------------- 1 | # Get-WacFeed 2 | 3 | This command gets an extension feed available in Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 9 | 10 | ## Example 1 11 | 12 | ```powershell 13 | Get-WacFeed -GatewayEndpoint https://localhost 14 | ``` 15 | 16 | The above command retrieves all extension feeds in Windows Admin Center. 17 | 18 | ## Example 2 19 | 20 | ```powershell 21 | Get-WacFeed -GatewayEndpoint https://localhost -Credential (Get-Credential) 22 | ``` 23 | 24 | The above command retrieves all extension feeds in Windows Admin Center. This command uses credentials to authenticate to WAC. 25 | 26 | -------------------------------------------------------------------------------- /docs/Install-WacExtension.md: -------------------------------------------------------------------------------- 1 | # Install-WacExtension 2 | 3 | This command installs a specified extension in Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | ExtensionId | Specifies the extension id that needs to be installed. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | | Version | Specifies the version of the extension to install. | | 11 | 12 | ## Example 1 13 | 14 | ```powershell 15 | Install-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' 16 | ``` 17 | 18 | The above command installs the most recent version of the extension 'ExtensionId' in Windows Admin Center. 19 | 20 | ## Example 2 21 | 22 | ```powershell 23 | Install-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' -Credential (Get-Credential) 24 | ``` 25 | 26 | The above command installs the most recent version of the extension 'ExtensionId' in Windows Admin Center. This command uses credentials to authenticate to WAC. 27 | 28 | ## Example 3 29 | 30 | ```powershell 31 | Install-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' -version 0.59.0 32 | ``` 33 | 34 | The above command installs extension 'ExtensionId' with version 0.59.0 in Windows Admin Center. 35 | 36 | -------------------------------------------------------------------------------- /docs/Remove-WacFeed.md: -------------------------------------------------------------------------------- 1 | # Remove-WacFeed 2 | 3 | This command removes an extension feed from Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | Path | Specifies the path to a WAC extension feed. This parameter is mandatory. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | 11 | ## Example 1 12 | 13 | ```powershell 14 | Remove-WacFeed -GatewayEndpoint https://localhost -Path '\\wac\share' 15 | ``` 16 | 17 | The above command will remove \\\wac\share as an extension feed from Windows Admin Center. 18 | 19 | ## Example 2 20 | 21 | ```powershell 22 | Remove-WacFeed -GatewayEndpoint https://localhost -Path '\\wac\share' -Credential (Get-Credential) 23 | ``` 24 | 25 | The above command will remove \\\wac\share as an extension feed from Windows Admin Center. This command uses credentials to authenticate to WAC. 26 | 27 | -------------------------------------------------------------------------------- /docs/Uninstall-WacExtension.md: -------------------------------------------------------------------------------- 1 | # Uninstall-WacExtension 2 | 3 | This command uninstalls a specified extension in Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | ExtensionId | Specifies the extension id that needs to be uninstalled. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | | Version | Specifies the version of the extension to install. | | 11 | 12 | ## Example 1 13 | 14 | ```powershell 15 | Uninstall-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' 16 | ``` 17 | 18 | The above command uninstalls the extension 'ExtensionId' in Windows Admin Center. 19 | 20 | ## Example 2 21 | 22 | ```powershell 23 | Uninstall-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' -Credential (Get-Credential) 24 | ``` 25 | 26 | The above command uninstalls the extension 'ExtensionId' in Windows Admin Center. This command uses credentials to authenticate to WAC. 27 | 28 | ## Example 3 29 | 30 | ```powershell 31 | Uninstall-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' -version 0.59.0 32 | ``` 33 | 34 | The above command uninstalls the extension 'ExtensionId' with version 0.59.0 in Windows Admin Center. 35 | 36 | -------------------------------------------------------------------------------- /docs/Update-WacExtension.md: -------------------------------------------------------------------------------- 1 | # Update-WacExtension 2 | 3 | This command updates a specified extension in Windows Admin Center. 4 | 5 | | Parameter Name | Description | Valid Values | 6 | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 7 | | GatewayEndpoint | Specifies the web URI at which WAC is running. This parameter is mandatory. | This must be full URI. For example, https://localhost:4040 or https://localhost or https://monitor.my.lab | 8 | | ExtensionId | Specifies the extension id that needs to be updated. | | 9 | | Credential | Specifies the credentials needed to authenticate to WAC. | | 10 | 11 | ## Example 1 12 | 13 | ```powershell 14 | Update-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' 15 | ``` 16 | 17 | The above command updates the extension 'ExtensionId' to the most recent version in Windows Admin Center. 18 | 19 | ## Example 2 20 | 21 | ```powershell 22 | Update-WacExtension -GatewayEndpoint https://localhost -ExtensionId 'ExtensionId' -Credential (Get-Credential) 23 | ``` 24 | 25 | The above command updates the extension 'ExtensionId' to the most recent version in Windows Admin Center. This command uses credentials to authenticate to WAC. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # PS Windows Admin Center 2 | 3 | > **Note**: This works with Windows Admin Center 1809.5 and above 4 | 5 | This module contains a set of commands to manage connections, feeds, and extensions in Windows Admin Center 6 | 7 | | DSC Resource Name | Description | 8 | | ---------------------- | ------------------------------------------------------------ | 9 | | Get-WacConnection | Gets connections added to Windows admin Center for management. This command supports shared connections introduced in 1902 insider preview. | 10 | | Add-WacConnection | Adds a new connection to Windows Admin Center for management. This command supports shared connections introduced in 1902 insider preview. | 11 | | Remove-WacConnection | Removes connection to Windows Admin Center for management. This command supports shared connections introduced in 1902 insider preview. | 12 | | Get-WacFeed | Gets all extension feeds available in Windows Admin Center. | 13 | | Add-WacFeed | Adds an extension feed to Windows Admin Center. | 14 | | Remove-WacFeed | Removes an extension feed from Windows Admin Center. | 15 | | Get-WacExtension | Gets all extensions available or installed in Windows Admin Center. | 16 | | Install-WacExtension | Installs an extension. | 17 | | Uninstall-WacExtension | Uninstalls an extension. | 18 | | Update-WacExtension | Updates an extension. | 19 | 20 | --------------------------------------------------------------------------------