This repository was archived by the owner on Dec 6, 2023. It is now read-only.
File tree 1 file changed +7
-3
lines changed
azure-migrate/dependencies-at-scale 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,8 @@ function Get-AzMigDiscoveredVMwareVMs {
98
98
Param (
99
99
[Parameter (Mandatory = $true )][string ]$ResourceGroupName ,
100
100
[Parameter (Mandatory = $true )][string ]$ProjectName ,
101
- [Parameter (Mandatory = $true )][string ]$OutputCsvFile = " VMwareVMs.csv"
101
+ [Parameter (Mandatory = $true )][string ]$OutputCsvFile = " VMwareVMs.csv" ,
102
+ [Parameter ()][string ]$ApplianceName = $null
102
103
)
103
104
104
105
if (-not (Test-Path - IsValid - Path $OutputCsvFile )) {
@@ -160,8 +161,11 @@ function Get-AzMigDiscoveredVMwareVMs {
160
161
161
162
$vmwareappliancemap = @ {}
162
163
# Discard non-VMware appliances
163
-
164
- $appMap.GetEnumerator () | foreach {if ($_.Value -match " VMwareSites" ) {$vmwareappliancemap [$_.Key ] = $_.Value }}
164
+ # If Appliance name is passed get data only for that appliance
165
+ # If Appliance name is not passed , get data for all appliances in that project
166
+ if (-not $ApplianceName ){
167
+ $appMap.GetEnumerator () | foreach {if ($_.Value -match " VMwareSites" ) {$vmwareappliancemap [$_.Key ] = $_.Value }}}else {
168
+ $appMap.GetEnumerator () | foreach {if ($_.Value -match " VMwareSites" -and $_.Key -eq $ApplianceName ) {$vmwareappliancemap [$_.Key ] = $_.Value }}}
165
169
Write-Debug $vmwareappliancemap.count
166
170
if ($vmwareappliancemap ) {$vmwareappliancemap | Out-String | Write-Debug };
167
171
if (-not $vmwareappliancemap.count ) {throw " No VMware VMs discovered in project" };
You can’t perform that action at this time.
0 commit comments