How to Import-PowershellDataFile EMBEDDED into EXE

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
GetScripty
Posts: 1
Last visit: Tue Mar 08, 2022 7:14 am

How to Import-PowershellDataFile EMBEDDED into EXE

Post by GetScripty »

Hi,

I am using Sapien 2020 to create a GUI exe and want to embed a PSD1 file into the form, then use Import-PowershellDataFile to import it. How would I do this?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How to Import-PowershellDataFile EMBEDDED into EXE

Post by jvierra »

Embedding a PSD1 file into a script will not do anything for you. A PSD1 file is just a file that sets the global values for a module.

Doing what you ask would serve no purpose. To load a module use "Import-Module" which loads the PSM1 and configures the module as specified in the PSD1 file.
This topic is 2 years and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked