首页 列表 - 第 2 页

PowerShell如何打开目录选择窗口

PowerShell如何打开目录选择窗口 $shell = New-Object -ComObject Shell.Application $selectedfolder = $shell.BrowseForFolder( 0, 'Select a folder', 16, $shell.NameSpace( 17 ).Self.Path ).Self.Path

Views:0  2020-04-11

PowerShell如何打开文件选择窗口

PowerShell如何打开文件选择窗口 Add-Type -AssemblyName System.Windows.Forms $initialDirectory = [Environment]::GetFolderPath( 'MyDocuments' ) $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $Ope

Views:0  2020-04-11

PowerShell如何弹出提示框

PowerShell如何弹出提示框 [void] [System.Windows.MessageBox]::Show( "Message", "Title", "OK", "Information" ) $answer = [System.Windows.MessageBox]::Show( "Dou yo

Views:0  2020-04-11

Windows如何使用PowerShell查看分区信息

Windows如何使用PowerShell查看分区信息 windows查看分区信息 #列出所有正在使用的驱动器号 $useddrives = @( ) Get-PSDrive -PSProvider FileSystem | ForEach-Object { $useddrives += $_.Name } #列出所有还可以使用的驱动器号 $availabledrives = @( ) [in

Views:0  2020-04-11

Windows如何使用PowerShell查看硬盘信息

Windows如何使用PowerShell查看硬盘信息 windows查看硬盘及其制造商、型号、大小、总线类型、物理位置等信息 Get-PhysicalDisk | Select BusType,DeviceID,FirmwareVersion,Manufacturer,MediaType,Model,PhysicalLocation,SerialNumber,Size | Sort-Object

Views:0  2020-04-11

如何获取PowerShell的版本

如何获取PowerShell的版本 Write-Host 'PowerShell Version' $PsVersionTable.PSVersion

Views:0  2020-04-11

在PowerShell中获取设置窗口标题

在PowerShell中获取设置窗口标题 $windowtitle = $Host.UI.RawUI.WindowTitle $Host.UI.RawUI.WindowTitle = 'onitroad window title'

Views:0  2020-04-11

在PowerShell中如何查看进程对应的命令行

在PowerShell中如何查看进程对应的命令行 在windows中如何查看某个进程的调用命令 $process = 'rundll32.exe' Get-WmiObject -Class Win32_Process -Filter "Name='$process'" | ForEach-Object $_.CommandLine

Views:0  2020-04-11

在PowerShell中如何获取脚本的名称和路径

在PowerShell中如何获取脚本的名称和路径 如何获取powershell脚本的命令行 [System.Environment]::CommandLine # 包含powershell可执行文件和脚本名称的单个字符串 [System.Environment]::GetCommandLineArgs( ) # 包含powershell可执行文件和脚本名称的字符串数组 $Args # 脚本参数的字

Views:0  2020-04-11

Windows如何使用PowerShell查看BIOS信息?

Windows如何使用PowerShell查看BIOS信息? param( [string]$Computer = "." ) if ( $computer -eq "." ) { $instances = Get-CimInstance -ClassName "Win32_BIOS" -Namespace "root/c

Views:0  2020-04-11

Windows如何使用PowerShell弹出光驱

Windows如何使用PowerShell弹出光驱 $colCDROMs = ( new-object -COM WMPlayer.OCX.7 ).cdromCollection for ( $i = 0; $i -lt $colCDROMs.count ; $i++ ) { $colCDROMs.Item( $i ).eject( ) }

Views:0  2020-04-11

Windows如何使用PowerShell查看内存使用情况

Windows如何使用PowerShell查看内存使用情况 查看windows可用内存 param( [string]$computer = "." ) $free = ( Get-WMIObject Win32_OperatingSystem -ComputerName $computer ).FreePhysicalMemory * 1KB $phys = ( Get-

Views:0  2020-04-11

在PowerShell中提示用户输入

在PowerShell中提示用户输入 如何捕获用户的输入 在PowerShell中,如何让用户输入信息? $input = Read-Host -Prompt "请输入名字,然后按回车" $key = [System.Console]::ReadKey( $true ).KeyChar # 获取字符 $key = [System.Console]::ReadKey( $tr

Views:0  2020-04-11

在perl中查找并替换字符串

在perl中查找并替换字符串 如何使用perl替换字符串 #! perl $string0 = "Hello world"; $string1 = "world"; $string2 = "onitroad"; $caseon = ""; $caseoff = ""; #如果不区分大小写,使

Views:0  2020-04-11

perl如何将Unix换行符替换成Windows回车换行符

perl如何将Unix换行符替换成Windows回车换行符 $line = "hello \n world"; $line =~ s/\015\012/\012/g; print $line;

Views:0  2020-04-11

在perl中如何读取注册表

在perl中如何读取注册表 如何使用perl读写注册表信息? #! perl $section = "HKEY_CURRENT_USER\\Environment"; $key = "path" if ( $section =~ m/^(HKEY_[^\\]+)\\(.+)$/i ) { $hive = uc( $1 ); $tree = $

Views:0  2020-04-11