To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build: PowerShell Studio 2019
Operating system: Windows 2016
PowerShell version(s): 5.1.14393.4583
*** Please add details and screenshots as needed below. ***
Trying to create a form to export results to a CSV file. My export button will have a folderbrowserdialog control which I want to set to a starting folder of H:\Reports. This folder does exist but when I set the location I get an error that it could not be enumerated.
$buttonExportResults_Click={
#TODO: Place custom script here
$folderbrowserdialog1.RootFolder = 'H:\Reports'
}
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
This is the error:
ERROR: Exception setting "RootFolder": "Cannot convert value "H:\Reports" to type "System.Environment+SpecialFolder". Error: "Unable to match the identifier name
ERROR: H:\Reports to a valid enumerator name. Specify one of the following enumerator names and try again:
(Forms) Selecting Starting Folder
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.
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.
Re: (Forms) Selecting Starting Folder
The property, RootFolder, has the enumerated type Environment.SpecialFolder. For more information, see https://docs.microsoft.com/en-us/dotnet ... esktop-5.0. You cannot set this property with a string.
To set the starting path with a string, I recommend switching to using the FolderBrowserModernDialog control. Then you can set the starting path by setting the property InitialDirectory.
To set the starting path with a string, I recommend switching to using the FolderBrowserModernDialog control. Then you can set the starting path by setting the property InitialDirectory.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.