@@ -32,17 +32,6 @@ function Install-SoftwarePackage
32
32
[string ]$WorkingDirectory
33
33
)
34
34
35
- # if the path cannot be found and starts with \\automatedlabsources...
36
- if ((-not (Test-Path - Path $Path ) -and $Path -match ' \\\\automatedlabsources[a-z]{5}\.file\.core\.windows\.net' ))
37
- {
38
- # we assume, the LabSources share was not mapped correctly and try again by calling 'C:\AL\AzureLabSources.ps1'
39
- $labSourcesConnectOutput = C:\AL\AzureLabSources.ps1
40
- if ($labSourcesConnectOutput.AlternativeLabSourcesPath )
41
- {
42
- $Path = $Path.Replace ($labSourcesConnectOutput.LabSourcesPath , $labSourcesConnectOutput.AlternativeLabSourcesPath )
43
- }
44
- }
45
-
46
35
$pInfo = New-Object - TypeName System.Diagnostics.ProcessStartInfo
47
36
$pInfo.FileName = $Path
48
37
if (-not [string ]::IsNullOrWhiteSpace($WorkingDirectory )) { $pInfo.WorkingDirectory = $WorkingDirectory }
@@ -76,6 +65,17 @@ function Install-SoftwarePackage
76
65
}
77
66
# endregion New-InstallProcess
78
67
68
+ # if the path cannot be found and starts with \\automatedlabsources...
69
+ if ((-not (Test-Path - Path $Path ) -and $Path -match ' \\automatedlabsources[a-z]{5}\.file\.core\.windows\.net' ))
70
+ {
71
+ # we assume, the LabSources share was not mapped correctly and try again by calling 'C:\AL\AzureLabSources.ps1'
72
+ $labSourcesConnectOutput = C:\AL\AzureLabSources.ps1 2> $null
73
+ if ($labSourcesConnectOutput.AlternativeLabSourcesPath )
74
+ {
75
+ $Path = $Path.Replace ($labSourcesConnectOutput.LabSourcesPath , $labSourcesConnectOutput.AlternativeLabSourcesPath )
76
+ }
77
+ }
78
+
79
79
if (-not (Test-Path - Path $Path - PathType Leaf))
80
80
{
81
81
Write-Error " The file '$Path ' could not found"
0 commit comments