Created
July 4, 2021 07:08
-
-
Save jesseloudon/ca111f680603e0edee35a42f23a3e264 to your computer and use it in GitHub Desktop.
mmaAddCloudWorkspace.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string]$workspaceId, | |
[string]$workspaceKey | |
) | |
$mma = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg' | |
if ($mma.GetCloudWorkspace($workspaceId).workspaceid -ne $workspaceId) | |
{ | |
$mma.AddCloudWorkspace($workspaceId, $workspaceKey) | |
$mma.ReloadConfiguration() | |
$mma.GetCloudWorkspace($workspaceId).ConnectionStatusText | |
Write-Verbose "Host $env:COMPUTERNAME is now configured for $workspaceId" -Verbose | |
} | |
else | |
{ | |
Write-Warning "Host $env:COMPUTERNAME already configured for $workspaceId" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment