Tip: You can specify a folder by using a GUI instead of manually copy/paste the path:
1 2 3 4 5 6 7 8 9 10 11 |
# Solution 1 Add-Type -AssemblyName System.Windows.Forms $browser = New-Object System.Windows.Forms.FolderBrowserDialog $null = $browser.ShowDialog() $path = $browser.SelectedPath # Solution 2 $application = New-Object -ComObject Shell.Application $path = ($application.BrowseForFolder(0, 'Select a folder', 0)).Self.Path |