11# Load MgCommandMetadata.json file
2- $CommandMetadataFile = (Join-Path $PSScriptRoot " ../ src\Authentication/ Authentication/ custom/ common/ MgCommandMetadata.json" )
2+ $CommandMetadataFile = (Join-Path $PSScriptRoot " ..\..\ src\Authentication\ Authentication\ custom\ common\ MgCommandMetadata.json" )
33# Convert JSON to HashTable
44$CommandMetadata = Get-Content $CommandMetadataFile | ConvertFrom-Json - AsHashTable
55
66# Check if Connect-MgGraph is in the list of commands
7- $ConnectCommand = $CommandMetadata | Where-Object { $_.Name -eq " Connect-MgGraph" }
7+ $ConnectCommand = $CommandMetadata | Where-Object { $_.Command -eq " Connect-MgGraph" }
88if ($null -eq $ConnectCommand ) {
99 # Add Connect-MgGraph to the list of commands
1010 $CommandMetadata += [pscustomobject ]@ {
@@ -27,7 +27,7 @@ if ($null -eq $ConnectCommand) {
2727}
2828
2929# Check if Add-MgEnvironment is in the list of commands
30- $AddEnvironmentCommand = $CommandMetadata | Where-Object { $_.Name -eq " Add-MgEnvironment" }
30+ $AddEnvironmentCommand = $CommandMetadata | Where-Object { $_.Command -eq " Add-MgEnvironment" }
3131if ($null -eq $AddEnvironmentCommand ) {
3232 # Add Add-MgEnvironment to the list of commands
3333 $CommandMetadata += [pscustomobject ]@ {
@@ -49,7 +49,7 @@ if ($null -eq $AddEnvironmentCommand) {
4949 Write-Host " Add-MgEnvironment command added to the list of commands in MgCommandMetadata.json"
5050}
5151# Check if Get-MgEnvironment is in the list of commands
52- $GetEnvironmentCommand = $CommandMetadata | Where-Object { $_.Name -eq " Get-MgEnvironment" }
52+ $GetEnvironmentCommand = $CommandMetadata | Where-Object { $_.Command -eq " Get-MgEnvironment" }
5353if ($null -eq $GetEnvironmentCommand ) {
5454 # Add Get-MgEnvironment to the list of commands
5555 $CommandMetadata += [pscustomobject ]@ {
@@ -71,7 +71,7 @@ if ($null -eq $GetEnvironmentCommand) {
7171 Write-Host " Get-MgEnvironment command added to the list of commands in MgCommandMetadata.json"
7272}
7373# Check if Remove-MgEnvironment is in the list of commands
74- $RemoveEnvironmentCommand = $CommandMetadata | Where-Object { $_.Name -eq " Remove-MgEnvironment" }
74+ $RemoveEnvironmentCommand = $CommandMetadata | Where-Object { $_.Command -eq " Remove-MgEnvironment" }
7575if ($null -eq $RemoveEnvironmentCommand ) {
7676 # Add Remove-MgEnvironment to the list of commands
7777 $CommandMetadata += [pscustomobject ]@ {
@@ -93,7 +93,7 @@ if ($null -eq $RemoveEnvironmentCommand) {
9393 Write-Host " Remove-MgEnvironment command added to the list of commands in MgCommandMetadata.json"
9494}
9595# Check if Set-MgEnvironment is in the list of commands
96- $SetEnvironmentCommand = $CommandMetadata | Where-Object { $_.Name -eq " Set-MgEnvironment" }
96+ $SetEnvironmentCommand = $CommandMetadata | Where-Object { $_.Command -eq " Set-MgEnvironment" }
9797if ($null -eq $SetEnvironmentCommand ) {
9898 # Add Set-MgEnvironment to the list of commands
9999 $CommandMetadata += [pscustomobject ]@ {
@@ -115,7 +115,7 @@ if ($null -eq $SetEnvironmentCommand) {
115115 Write-Host " Set-MgEnvironment command added to the list of commands in MgCommandMetadata.json"
116116}
117117# Check if Disconnect-MgGraph is in the list of commands
118- $DisconnectCommand = $CommandMetadata | Where-Object { $_.Name -eq " Disconnect-MgGraph" }
118+ $DisconnectCommand = $CommandMetadata | Where-Object { $_.Command -eq " Disconnect-MgGraph" }
119119if ($null -eq $DisconnectCommand ) {
120120 # Add Disconnect-MgGraph to the list of commands
121121 $CommandMetadata += [pscustomobject ]@ {
@@ -137,7 +137,7 @@ if ($null -eq $DisconnectCommand) {
137137 Write-Host " Disconnect-MgGraph command added to the list of commands in MgCommandMetadata.json"
138138}
139139# Check if Find-MgGraphCommand is in the list of commands
140- $FindCommand = $CommandMetadata | Where-Object { $_.Name -eq " Find-MgGraphCommand" }
140+ $FindCommand = $CommandMetadata | Where-Object { $_.Command -eq " Find-MgGraphCommand" }
141141if ($null -eq $FindCommand ) {
142142 # Add Find-MgGraphCommand to the list of commands
143143 $CommandMetadata += [pscustomobject ]@ {
@@ -159,7 +159,7 @@ if ($null -eq $FindCommand) {
159159 Write-Host " Find-MgGraphCommand command added to the list of commands in MgCommandMetadata.json"
160160}
161161# Check if Find-MgGraphPermission is in the list of commands
162- $FindPermissionCommand = $CommandMetadata | Where-Object { $_.Name -eq " Find-MgGraphPermission" }
162+ $FindPermissionCommand = $CommandMetadata | Where-Object { $_.Command -eq " Find-MgGraphPermission" }
163163if ($null -eq $FindPermissionCommand ) {
164164 # Add Find-MgGraphPermission to the list of commands
165165 $CommandMetadata += [pscustomobject ]@ {
@@ -181,7 +181,7 @@ if ($null -eq $FindPermissionCommand) {
181181 Write-Host " Find-MgGraphPermission command added to the list of commands in MgCommandMetadata.json"
182182}
183183# Check if Get-MgContext is in the list of commands
184- $GetContextCommand = $CommandMetadata | Where-Object { $_.Name -eq " Get-MgContext" }
184+ $GetContextCommand = $CommandMetadata | Where-Object { $_.Command -eq " Get-MgContext" }
185185if ($null -eq $GetContextCommand ) {
186186 # Add Get-MgContext to the list of commands
187187 $CommandMetadata += [pscustomobject ]@ {
@@ -203,7 +203,7 @@ if ($null -eq $GetContextCommand) {
203203 Write-Host " Get-MgContext command added to the list of commands in MgCommandMetadata.json"
204204}
205205# Check if Get-MgGraphOption is in the list of commands
206- $GetGraphOptionCommand = $CommandMetadata | Where-Object { $_.Name -eq " Get-MgGraphOption" }
206+ $GetGraphOptionCommand = $CommandMetadata | Where-Object { $_.Command -eq " Get-MgGraphOption" }
207207if ($null -eq $GetGraphOptionCommand ) {
208208 # Add Get-MgGraphOption to the list of commands
209209 $CommandMetadata += [pscustomobject ]@ {
@@ -225,7 +225,7 @@ if ($null -eq $GetGraphOptionCommand) {
225225 Write-Host " Get-MgGraphOption command added to the list of commands in MgCommandMetadata.json"
226226}
227227# Check if Get-MgRequestContext is in the list of commands
228- $GetRequestContextCommand = $CommandMetadata | Where-Object { $_.Name -eq " Get-MgRequestContext" }
228+ $GetRequestContextCommand = $CommandMetadata | Where-Object { $_.Command -eq " Get-MgRequestContext" }
229229if ($null -eq $GetRequestContextCommand ) {
230230 # Add Get-MgRequestContext to the list of commands
231231 $CommandMetadata += [pscustomobject ]@ {
@@ -247,7 +247,7 @@ if ($null -eq $GetRequestContextCommand) {
247247 Write-Host " Get-MgRequestContext command added to the list of commands in MgCommandMetadata.json"
248248}
249249# Check if Invoke-MgGraphRequest is in the list of commands
250- $InvokeRequestCommand = $CommandMetadata | Where-Object { $_.Name -eq " Invoke-MgGraphRequest" }
250+ $InvokeRequestCommand = $CommandMetadata | Where-Object { $_.Command -eq " Invoke-MgGraphRequest" }
251251if ($null -eq $InvokeRequestCommand ) {
252252 # Add Invoke-MgGraphRequest to the list of commands
253253 $CommandMetadata += [pscustomobject ]@ {
@@ -269,7 +269,7 @@ if ($null -eq $InvokeRequestCommand) {
269269 Write-Host " Invoke-MgGraphRequest command added to the list of commands in MgCommandMetadata.json"
270270}
271271# Check if Set-MgGraphOption is in the list of commands
272- $SetGraphOptionCommand = $CommandMetadata | Where-Object { $_.Name -eq " Set-MgGraphOption" }
272+ $SetGraphOptionCommand = $CommandMetadata | Where-Object { $_.Command -eq " Set-MgGraphOption" }
273273if ($null -eq $SetGraphOptionCommand ) {
274274 # Add Set-MgGraphOption to the list of commands
275275 $CommandMetadata += [pscustomobject ]@ {
@@ -291,7 +291,7 @@ if ($null -eq $SetGraphOptionCommand) {
291291 Write-Host " Set-MgGraphOption command added to the list of commands in MgCommandMetadata.json"
292292}
293293# Check if Set-MgRequestContext is in the list of commands
294- $SetRequestContextCommand = $CommandMetadata | Where-Object { $_.Name -eq " Set-MgRequestContext" }
294+ $SetRequestContextCommand = $CommandMetadata | Where-Object { $_.Command -eq " Set-MgRequestContext" }
295295if ($null -eq $SetRequestContextCommand ) {
296296 # Add Set-MgRequestContext to the list of commands
297297 $CommandMetadata += [pscustomobject ]@ {
0 commit comments