如何在powershell中使用IFileOpenDialog

时间:2018-06-06 15:45:24

标签: powershell user-interface

我需要自定义OpenFileDialog并删除左侧面板。

    Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
    InitialDirectory = $InitialDirectory
    Multiselect = $true
    Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx' # 'All Files (*.*)|*.*'
    Title = $Title
}

[void]$FileBrowser.ShowDialog()
$FileBrowser.FileNames

OpenFileDialog无效。

这似乎可以用IFileOpenDialog(他有_FILEOPENDIALOGOPTIONS),但我不能在powershell中使用它

0 个答案:

没有答案