@@ -42,21 +42,12 @@ if(!(Get-Item $path -ErrorAction SilentlyContinue)) {
4242 New-ItemProperty - Path $path - Name $itemName - Value 0 - PropertyType dword
4343}
4444
45- $runStep = Get-ItemProperty - Path $path - Name $itemName - ErrorAction SilentlyContinue | Select-Object - ExpandProperty $itemName
4645Write-Output " Write-Host "" Uninstall FSxn configuration"" " >> $uninstallFile
4746Write-Output " # FSXn uninstall:" >> $uninstallFile
4847
49- if ($runStep -eq 0 ) {
50- if (Get-Module | Where-Object {$_.Name -ne ' NuGet' }) {
51- Install-PackageProvider - Name NuGet - MinimumVersion 2.8 .5.201 - Force
52- @ (" Uninstall-PackageProvider -Name NuGet -Force" ) + (Get-Content $uninstallFile ) | Set-Content $uninstallFile
53- }
54- Set-ItemProperty - Path $path - Name $itemName - Value 1
55- }
56-
5748$runStep = Get-ItemProperty - Path $path - Name $itemName - ErrorAction SilentlyContinue | Select-Object - ExpandProperty $itemName
5849
59- if ($runStep -eq 1 ) {
50+ if ($runStep -eq 0 ) {
6051
6152 # ## Install MPIO ####
6253 Write-Output " Installing Multipath-IO windows feature" >> $currentLogPath
@@ -72,7 +63,7 @@ if($runStep -eq 1) {
7263 else {
7364 # restart the instance after installing MPIO
7465 Install-WindowsFeature - name Multipath- IO - Restart
75- @ (" Uninstall-PackageProvider -Name Multipath-IO -Force " ) + (Get-Content $uninstallFile ) | Set-Content $uninstallFile
66+ @ (" Uninstall-WindowsFeature -Name Multipath-IO -Remove -Confirm: $false " ) + (Get-Content $uninstallFile ) | Set-Content $uninstallFile
7667 }
7768
7869 $vol_number = get-random - Minimum 1 - Maximum 10000
@@ -352,7 +343,7 @@ if($runStep -eq 1) {
352343 Write-Host " Failed create new partition, due to: $_ " - ForegroundColor Red - ErrorAction stop
353344 break
354345 }
355- Set-ItemProperty - Path $path - Name $itemName - Value 2
346+ Set-ItemProperty - Path $path - Name $itemName - Value 1
356347 Write-Output " Done creating new FSx disk, drive letter: $drive_letter " >> $currentLogPath
357348 Write-Host " Done creating new FSx disk, drive letter: $drive_letter " - ForegroundColor Green
358349}
0 commit comments