Skip to content

Commit 2f121c9

Browse files
committed
Enabled full remote support
1 parent 9aeb990 commit 2f121c9

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

functions/New-PSDCImage.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@
259259
$availableMB = (Get-PSDrive -Name $ImageLocalPath.Substring(0, 1)).Free / 1MB
260260
}
261261
else {
262-
$command = [ScriptBlock]::Create("(Get-PSDrive -Name $($ImageLocalPath).Substring(0, 1)).Free / 1MB")
263-
$ImageLocalPath = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $commandGetLocalPath -Credential $DestinationCredential
262+
$command = [ScriptBlock]::Create("(Get-PSDrive -Name $($ImageLocalPath.Substring(0, 1)) ).Free / 1MB")
263+
$availableMB = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $commandGetLocalPath -Credential $DestinationCredential
264264
}
265265

266266
$dbSizeMB = $db.Size
@@ -303,7 +303,7 @@
303303
$null = New-PSDCVhdDisk -Destination $imagePath -FileName "$imageName.vhdx"
304304
}
305305
else {
306-
$command = [ScriptBlock]::Create("$null = New-PSDCVhdDisk -Destination $imagePath -FileName '$imageName.vhdx'")
306+
$command = [ScriptBlock]::Create("New-PSDCVhdDisk -Destination $imagePath -FileName '$imageName.vhdx'")
307307
$null = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
308308
}
309309

@@ -321,7 +321,7 @@
321321
$diskResult = Initialize-PSDCVhdDisk -Path $vhdPath -Credential $DestinationCredential
322322
}
323323
else {
324-
$command = [ScriptBlock]::Create("Initialize-PSDCVhdDisk -Path $vhdPath -Credential $DestinationCredential")
324+
$command = [ScriptBlock]::Create("Initialize-PSDCVhdDisk -Path $vhdPath")
325325
$diskResult = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
326326
}
327327
}
@@ -337,10 +337,10 @@
337337
try {
338338
# Check if computer is local
339339
if ($computer.IsLocalhost) {
340-
$null = New-Item -Path $accessPath -ItemType Directory -Force:$Force
340+
$null = New-Item -Path $accessPath -ItemType Directory -Force
341341
}
342342
else {
343-
$command = [ScriptBlock]::Create("New-Item -Path $accessPath -ItemType Directory -Force:$Force")
343+
$command = [ScriptBlock]::Create("New-Item -Path $accessPath -ItemType Directory -Force")
344344
$null = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
345345
}
346346
}
@@ -358,7 +358,7 @@
358358
$null = Add-PartitionAccessPath -DiskNumber $disk.Number -PartitionNumber $partition[1].PartitionNumber -AccessPath $accessPath -ErrorAction SilentlyContinue
359359
}
360360
else {
361-
$command = [ScriptBlock]::Create("Add-PartitionAccessPath -DiskNumber $disk.Number -PartitionNumber $partition[1].PartitionNumber -AccessPath $accessPath -ErrorAction SilentlyContinue")
361+
$command = [ScriptBlock]::Create("Add-PartitionAccessPath -DiskNumber $($disk.Number) -PartitionNumber $($partition[1].PartitionNumber) -AccessPath $accessPath -ErrorAction SilentlyContinue")
362362
$null = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
363363
}
364364

0 commit comments

Comments
 (0)