This file contains hidden or 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
| import-xml 的类存储在整个系统的类,直接在powershell启动时import | |
| 还有一种类是环境类。这种类只在程序/模组里启用 |
This file contains hidden or 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-Type -AssemblyName System.Windows.Forms | |
| $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') } | |
| $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ | |
| #选择路径 | |
| InitialDirectory = [Environment]::GetFolderPath('Desktop') | |
| #filter 后缀 | |
| Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx' | |
| } | |
| $Null = $FileBrowser.ShowDialog() |
This file contains hidden or 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
| for ($i = 0; $i -eq 0) { | |
| #鎸塃nter 鑾峰彇浣犵殑鍏綉IP... | |
| Write-Host "鎸塃nter 鑾峰彇浣犵殑鍏綉IP..." | |
| $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | |
| Write-Host "姝e湪鑾峰彇鍏綉IP..." | |
| $ip = (Invoke-WebRequest -Uri "http://ipinfo.io/ip").Content | |
| Write-Host "浣犵殑鍏綉IP鏄? $ip" | |
| } |
OlderNewer