In my powershell script I open a FolderBrowserDialog to get a path from User. I'd like to allow User to create new folder but I get this message regardless of folder selected.
[Window Title] Invalid location
[Content] You can't create a new folder here. Choose a different location.
I thought maybe I need to elevate the execution policy on PowerShell, but that didn't make a difference.
# [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
Add-Type -AssemblyName System.Windows.Forms
$FBD = New-Object System.Windows.Forms.FolderBrowserDialog
$FBD.ShowNewFolderButton = $True
$FBD.RootFolder = "MyComputer"
$FBD.SelectedPath = "C:\"
$FBD.Description = "Navigate and select directory"
$Choice = $FBD.ShowDialog()
if ($Choice -eq "OK")
{
Write-Host "Selected Path: " $FBD.SelectedPath
}
UPDATE Additional info:
- I can manually create folder inside explorer
- I can create folder within powershell with 'New-Item', without elevated privilege
Things I've tried without success:
- Running terminal with elevated privileges
- Using Python TKinter filedialog (same issue)?!
All in all it seems like a Windows permission issue with calling Windows Forms.


C:(or wherever you navigate to)? - Mathias R. Jessen