This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add following 2 dlls to the script directory | |
# dlls from https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Shell | |
# and from https://www.nuget.org/packages/Microsoft-WindowsAPICodePack-Core | |
# for some mystical reason the script does not run in ISE but console will do | |
Add-Type -Path "$($PSScriptRoot)\Microsoft.WindowsAPICodePack.Shell.dll" | |
$dialog = New-Object Microsoft.WindowsAPICodePack.Dialogs.CommonOpenFileDialog | |
$dialog.IsFolderPicker = $true; | |
if ($Dialog.ShowDialog() -eq [Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogResult]::Ok) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[void] [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | |
function Get-Folder() { | |
param | |
( | |
[Parameter(Mandatory=$false)][string]$initialDirectory = $ENV:USERPROFILE | |
) | |
try { |