diff --git a/.vscode/launch.json b/.vscode/launch.json index e83cb91..be2a673 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "preLaunchTask": "dotnet: build-module", // replace with your actual build task name "script": "pwsh.exe -noexit -command Import-Module .\\bin\\Debug\\net6.0\\TokenMagician.dll", // replace with your actual script path //"script": "-noexit -command &{ Import-Module .\\bin\\TokenMagician.dll }", // replace with your actual script path - "cwd": "${workspaceFolder}" + "cwd": "${workspaceFolder}\\src\\TokenMagician" } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f9edc3a..9df3974 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ { "type": "shell", "label": "dotnet: build-module", - "command": "dotnet build ${workspaceFolder}\\TokenMagician.csproj", + "command": "dotnet build ${workspaceFolder}\\src\\TokenMagician\\TokenMagician.csproj", "group": { "kind": "build", "isDefault": true diff --git a/src/TokenMagician.Loader/ModuleLoader.cs b/src/TokenMagician.Loader/ModuleLoader.cs index 8a01d01..2a32a3e 100644 --- a/src/TokenMagician.Loader/ModuleLoader.cs +++ b/src/TokenMagician.Loader/ModuleLoader.cs @@ -28,6 +28,7 @@ public class ModuleLoader : AssemblyLoadContext private ModuleLoader(string mainModulePathAssemblyPath) : base (name: "TokenMagician", isCollectible: false) { + Console.WriteLine($"Loading module from {mainModulePathAssemblyPath}"); _assemblyDir = Path.GetDirectoryName(mainModulePathAssemblyPath) ?? ""; _thisAssembly = typeof(ModuleLoader).Assembly; _thisAssemblyName = _thisAssembly.GetName(); @@ -62,6 +63,7 @@ private ModuleLoader(string mainModulePathAssemblyPath) /// public static Assembly Initialize() { + Console.WriteLine("Initializing ModuleLoader"); ModuleLoader? instance = _instance; if (instance is not null) { @@ -72,6 +74,7 @@ public static Assembly Initialize() { if (_instance is not null) { + Console.WriteLine("ModuleLoader already initialized"); return _instance._moduleAssembly; } diff --git a/src/TokenMagician/TokenMagician.psd1 b/src/TokenMagician/TokenMagician.psd1 index ea17043..2cc5c9c 100644 --- a/src/TokenMagician/TokenMagician.psd1 +++ b/src/TokenMagician/TokenMagician.psd1 @@ -59,21 +59,17 @@ # FunctionsToExport = @() # Cmdlets to export from this module. - # CmdletsToExport = @( - # "Deploy-WtWin32App", - # "Get-WtWin32Apps", - # "New-IntuneWinPackage", - # "New-WtWingetPackage", - # "Remove-WtWin32App", - # "Unprotect-IntuneWinPackage" - # "Update-WtIntuneApp" - # ) + CmdletsToExport = @( + "Get-TmMsiToken" + ) # Variables to export from this module. # VariablesToExport = @() # Aliases to export from this module. - # AliasesToExport = @() + AliasesToExport = @( + "Get-MsiToken" + ) # List of all files included in this module. FileList = @(