July 2018
Beginner
552 pages
13h 18m
English
When working on Windows, you always have the benefit of making use of integrated Windows features. One of these is OpenFileDialog, which comes with the PresentationFramework library. The following function demonstrates a simple usage of it to retrieve and return selected files within the GUI:
function Show-OpenFileDialog{ <# .SYNOPSIS Shows up an open file dialog. .EXAMPLE Show-OpenFileDialog #> [CmdletBinding()] param ( [Parameter(Mandatory=$false, Position=0)] [System.String] $Title = 'Windows PowerShell', [Parameter(Mandatory=$false, Position=1)] [Object] $InitialDirectory = "$Home\Documents", [Parameter(Mandatory=$false, Position=2)] [System.String] $Filter = 'PowerShell-files|*.ps1|Everything|*.*' ) Add-Type -AssemblyName ...
Read now
Unlock full access