您现在的位置是:网站首页> 编程资料编程资料
Powershell小技巧之等待输入一个按键_PowerShell_
2023-05-26
385人已围观
简介 Powershell小技巧之等待输入一个按键_PowerShell_
支持所有PS版本,仅支持PS控制台。
当一个脚本使用PS控制台启动时,你可能想要在中间穿插一个“输入任意键”。这里有一个方法可以实现:
Write-Host 'Press Any Key!' -NoNewline $null = [Console]::ReadKey('?') 这只能正常运行在PS控制台。它将不能运行在ISE编辑器或任何其它PS编辑器,它们没有在真实控制台的将没有键盘交互效果。
您可能感兴趣的文章:
相关内容
- Powershell小技巧之使用Update-TypeData扩展类型系统_PowerShell_
- Powershell小技巧之找出脚本中的错误_PowerShell_
- Windows Powershell对象转换成文本_PowerShell_
- Windows Powershell使用管道_PowerShell_
- Windows Powershell使用哈希表_PowerShell_
- Windows Powershell强类型数组_PowerShell_
- Powershell小技巧之获取当前的时间并转换为时辰_PowerShell_
- Powershell小技巧之判断是否包涵大小写_PowerShell_
- PowerShell小技巧之调用CloudFlare的SDK查询网站统计信息_PowerShell_
- PowerShell小技巧实现IE Web自动化_PowerShell_
