You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ .\PowerGPT.ps1 "print first lines and last lines for each file in current folder"
The description is too vague,do you mean:
[0] For each file in current directory, print the first line and then print the last line of the file.
[1] For each file in current directory, print the first line of the file. After that,for each file, print the last line of the file.
Choose one description that matches your task: : 1
Will execute script:
-----Get-ChildItem|ForEach-Object {
$file=$_.FullNameWrite-Host"First line of $file:"Get-Content$file-TotalCount 1
}
Get-ChildItem|ForEach-Object {
$file=$_.FullNameWrite-Host"Last line of $file:"Get-Content$file-Tail 1
}
-----continue?([y]es, [n]o)
-----
写PowerShell脚本需要一定的专业知识,有时也较为麻烦,但我们常常会有在Windows下用进行批量操作的需求。
PowerGPT
是一个纯PowerShell编写的轻量工具,只需要打出PowerGPT <要执行的任务>
就可以让AI帮你编写命令并执行。安装十分简单,在PowerShell中运行:
首次运行时需要输入OpenAI API Key,在国内环境下时需要打开系统代理。
Github: https://github.com/ouromoros/PowerGPT
The text was updated successfully, but these errors were encountered: