首页 > 系统相关 >PowerShell 创建一个文件选择器

PowerShell 创建一个文件选择器

时间:2022-12-15 16:23:50浏览次数:65  
标签:Windows 创建 System filePicker PowerShell Forms 选择器

从这篇文章得到借鉴   PowerShell 技能连载 - 创建一个文件夹选择器 - 叹为观止 (vichamp.com)

(80条消息) PowerShell GUI 之基础知识_feiqizhanghao的博客-CSDN博客_powershell ui

原理都是从powershell中反射调用。net   System.Windows.Forms的命名空间    会c#的一看就懂

 

代码

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()

$filePicker = New-Object System.Windows.Forms.OpenFileDialog
$null = $filePicker.ShowDialog()
$Path = $filePicker.FileName

"You selected: $Path"

 

标签:Windows,创建,System,filePicker,PowerShell,Forms,选择器
From: https://www.cnblogs.com/kyo413/p/16985329.html

相关文章