Powershell Folder Picker Dialog

Mitglied: natalie.solero
Hello Guys :-) face-smile

i'm just thinking about to implement a folder picking dialog box in my existing script.
In my existing script i want to install fonts on a remote machine. This script is working fine, but i need to write the folder path harcoded into the script.
Now i want to change this.

This is my script which is installing the fonts.

In line 13, i'm trying to change it with the following folder picker dialog.

Replacing the hardcoded folder with the
does not work. There is no error message.

Content-Key: 658826

Url: https://administrator.pro/contentid/658826

Printed on: September 23, 2021 at 12:09 o'clock

Mitglied: GarfieldBonn
GarfieldBonn Mar 04, 2021 at 12:51:51 (UTC)
Goto Top
Hello,

should it no be

$FontDir = Get-Folder
Mitglied: natalie.solero
natalie.solero Mar 04, 2021 at 12:59:20 (UTC)
Goto Top
Unfortunately i't doesn't work. The script closes directly without any error message.
Mitglied: GarfieldBonn
GarfieldBonn Mar 04, 2021 at 14:42:49 (UTC)
Goto Top
i tested it up to the foreach loop. It works fine.

How do you bind the function? Same script or via include-path?

The scipt works fine withput the function? Then it must be how how you bind it to the rest.