Is there a way to specify a RunAs user when packaging the exe? So that when the EXE is run it is always run as that specific user.
Also, in the Resources = [string[]]@() section of the package.psd1 do all files have to be in the root directory or can you specify sub folders and files ie. Resources = [string[]]@("file1.jpg","folder\file2.jpg")
Sure. It’s something we can look into. We would likely be able to do some impersonation within the process to achieve this. I’ll open a feature request for it.
Another question about including resources when packaging. The documentation shows how to reference the resource in XAML. How would you reference these files in the PowerShell script?
Specifically, I am creating a WPF UI for a script and need to Load some DLLs (ie [void][System.Reflection.Assembly]::LoadFrom('assembly\MaterialDesignThemes.Wpf.dll'). But i can’t seem to get the sourcing correct in the script for it to work in an exe.
This is my first project to convert a PS1 to EXE with embedded resources, in this case 1 exe file and 3 xml files alongside the ps1 itself. (this is the officedeploy tool with setup.exe and 3 different xml files for the configuration switches.
the PS1 is a windows.form with 3 buttons, each of them calling the setup.exe with different switch
so I need to carry the 4 files along with the script itself
anyway, i manage to load the 4 files as resources: