When importing the active directoy module and then packaging as an EXE the import hangs and then times out.
Build Log:
VERBOSE: Checking license
VERBOSE: OutputPath is C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\out
VERBOSE: Bundling C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\Service Desk User Tool.ps1
VERBOSE: Parsing file C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\Service Desk User Tool.ps1.
VERBOSE: Found module import 'Import-Module ActiveDirectory' at 0
VERBOSE: Packager PSModulePath: C:\Users\mahers\OneDrive - ****************************************\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;c:\Users\mahers\.vscode\extensions\ms-vscode.powershell-2021.12.0\modules;C:\Users\mahers\PowerShellProTools\2022.2.1\windows\..\Modules
VERBOSE: Replacing module ActiveDirectory
VERBOSE: Packaging C:\Users\mahers\AppData\Local\Temp\Service Desk User Tool.ps1
VERBOSE: Creating temp directory: C:\Users\mahers\AppData\Local\Temp\6bcdab3c9b0647df8468de634b816af7
VERBOSE: Packaging modules...
VERBOSE: Checking dotnet version.
VERBOSE: Checking dotnet SDK version.
VERBOSE: 6.0.200
VERBOSE: .NET SDK Version: 6.0.200
VERBOSE: Creating package project.
VERBOSE: Using .NET Framework version: net462
VERBOSE: Determining projects to restore...
Restored C:\Users\mahers\AppData\Local\Temp\6bcdab3c9b0647df8468de634b816af7\Service Desk User Tool.csproj (in 73 ms).
VERBOSE: Determining projects to restore...
Restored C:\Users\mahers\AppData\Local\Temp\6bcdab3c9b0647df8468de634b816af7\Service Desk User Tool.csproj (in 73 ms).
VERBOSE: Packaging C:\Users\mahers\AppData\Local\Temp\Service Desk User Tool.ps1 -> C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\out\Service Desk User Tool.exe
VERBOSE: Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Service Desk User Tool -> C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\out\Service Desk User Tool.exe
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.02
VERBOSE: Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Service Desk User Tool -> C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\out\Service Desk User Tool.exe
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.02
VERBOSE: Output: C:\Users\mahers\OneDrive - ****************************************\Documents\Dev\Powershell\out\Service Desk User Tool.exe
When I run the EXE i get this for a few mins then it times out.
The code is using Import-Module ActiveDirectory
Does anyone have any ideas why this happening?