Skip to content

Commit dde3f0a

Browse files
authored
CI: Fix AzDevOps not being recognized as a CI and failing build during zip creation (#4)
1 parent b3fec6c commit dde3f0a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

PoshNmap/PoshNmap.psm1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ $AssembliesToLoad = Get-ChildItem -Path "$PSScriptRoot\lib\*-$dotNetTarget.dll"
77
if ($AssembliesToLoad) {
88
#If we are in a build or a pester test, load assemblies from a temporary file so they don't lock the original file
99
#This helps to prevent cleaning problems due to a powershell session locking the file because unloading a module doesn't unload assemblies
10-
if ($BuildTask -or $TestDrive) {
10+
if ($BuildTask -or $TestDrive -or $env:BUILD_BUILDID) {
1111
write-verbose "Detected Invoke-Build or Pester, loading assemblies from a temp location to avoid locking issues"
12-
<# TODO: Redo this to test for assemblies and if they are in the same path or a temp directory, warn about it. Global vars are bad mmkay.
13-
if ($Global:BuildAssembliesLoadedPreviously) {
14-
write-warning "You are in a build or test environment. We detected that module assemblies were loaded in this same session on a previous build or test. Strongly recommend you kill the process and start a new session for a clean build/test!"
15-
}
16-
#>
1712

1813
$TempAssembliesToLoad = @()
1914
foreach ($AssemblyPathItem in $AssembliesToLoad) {
2015
$TempAssemblyPath = [System.IO.Path]::GetTempFileName() + ".dll"
2116
Copy-Item $AssemblyPathItem $TempAssemblyPath
2217
$TempAssembliesToLoad += [System.IO.FileInfo]$TempAssemblyPath
2318
}
19+
2420
$AssembliesToLoad = $TempAssembliesToLoad
2521
}
2622

0 commit comments

Comments
 (0)