如何创建一个Powershell脚本输出cmd-让示例文件到txt文件?

时间:2016-04-15 17:34:51

标签: file powershell

我问了这个,然后自己想出了答案。请参阅以下示例:

1 个答案:

答案 0 :(得分:-1)

$filename = Read-Host -Prompt 'Input the Command you want examples for'
$pathloc = Read-Host -Prompt "Enter the path of where the example files will be stored"

get-help $filename -Examples | Out-File ($pathloc + $filename + ".txt")