Skip to content

Commit 907f0b2

Browse files
committed
Added importd when executed remotely
1 parent a95c81a commit 907f0b2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

functions/New-PSDCImage.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@
164164
$computer = [PsfComputer]$uriHost
165165

166166
if (-not $computer.IsLocalhost) {
167+
$command = [ScriptBlock]::Create("Import-Module dbatools")
168+
Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
169+
170+
$command = [ScriptBlock]::Create("Import-Module PSFramework")
171+
Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
172+
173+
$command = [ScriptBlock]::Create("Import-Module PSDatabaseClone")
174+
Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
175+
167176
$command = "Convert-PSDCLocalUncPathToLocalPath -UncPath '$ImageNetworkPath'"
168177
$commandGetLocalPath = [ScriptBlock]::Create($command)
169178
}

0 commit comments

Comments
 (0)