随笔分类 - powershell
摘要:Read-Host 获取用户输入值Write-Host 输出回显$newName=Read-Host"Pleaseinputthenewnameforthestring'test',leaveasdefault,pressEnter:"Write-Host"Processing..."$newLine=[System.Environment]::NewLine$dir=(Get-Location).Path+"\"$file=$dir+"test.txt"$a+=Get-Content$fileif
阅读全文
摘要:for /f "tokens=*" %%a in ('powershell Get-ExecutionPolicy') do (set originPolicy=%%a)通过for循环查找功能来将 powershell 命令的值赋给 batch file 变量@echooffsetdir=%CD%setscriptPath=%dir%\example.ps1for/f"tokens=*"%%ain('powershellGet-ExecutionPolicy')do(setoriginPolicy=%%a)powershe
阅读全文
浙公网安备 33010602011771号