Product, version and build: PowerShell Studio 2016 (5.3.130.0)
32 or 64 bit version of product: x64
Operating system: Windows Server 2012 R2
32 or 64 bit OS: x64
PowerShell Version: 4.0
I would like to use the *exe.config file, which is generated in the Packaging process, to store configuration information used by my PowerShell script/application. But I could not find any information, if this is possible or how to achive this. I am aware about the possibilities to store/load Variables with Export-CliXml, but I would like to achieve this via PowerShell Studio features.
Storing configuration in *exe.config file
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- TimoNieland
- Posts: 1
- Last visit: Fri Feb 18, 2022 3:02 pm
Re: Storing configuration in *exe.config file
PowerShell Studio doesn't offer any options to configure the application .config file other than what is automatically generated.
You can, after generating the config file for the first time, disable the option the generated the config file. This way any changes you make to the config file will not get overwritten by the packager.
As for access the config settings, you can look at using the ConfigurationManager class:
https://msdn.microsoft.com/en-us/librar ... nager.aspx
I recommend posting on the PowerShell forum for further assistance on how to read the settings.
You can, after generating the config file for the first time, disable the option the generated the config file. This way any changes you make to the config file will not get overwritten by the packager.
As for access the config settings, you can look at using the ConfigurationManager class:
https://msdn.microsoft.com/en-us/librar ... nager.aspx
- Add-Type -AssemblyName System.Configuration
- [System.Configuration.ConfigurationManager]
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.