This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.register | |
| Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2" | |
| 2.获取API | |
| 访问 PowerShell Gallery 网站。https://www.powershellgallery.com/ | |
| 点击 "Sign in" 并使用 Microsoft 账号登录。 | |
| 进入 "API Keys" 页面,创建一个新的 API Key(建议权限为 Push-Only 以提高安全性)。 | |
| 复制 API Key,稍后会用到。 | |
| 3.在模组中创建psd 包含作者名字,描述,模组名字 | |
| New-ModuleManifest -Path .\console.psd1 -Description "console grid using out-consolegridview for series occasion" -Author 'cn_codegod' -ModuleVersion "1.0" -RequiredModules "Microsoft.PowerShell.ConsoleGuiTools" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 基本命令 | |
| oh-my-posh init pwsh --config $env:homedir\theme3.json|Invoke-Expression | |
| 模板一:添加文字 | |
| { | |
| "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
| "final_space": true, | |
| "version": 3, | |
| "blocks": [ | |
| { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 按下 Win + R 键打开运行对话框,输入 taskschd.msc,然后按回车。 | |
| 在任务计划程序中点击“创建基本任务...”或“创建任务...”。 | |
| 输入任务的名称和描述,选择触发任务的条件。 | |
| 设置触发器信息,如特定时间、登录时等。 | |
| 设置操作,例如运行某个程序。 | |
| 查看设定好的任务。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Description | |
| The Set-PSReadLineKeyHandler cmdlet customizes the result when a key or sequence of keys is pressed. With user-defined key bindings, you can do almost anything that's possible from within a PowerShell script. | |
| Examples | |
| Example 1: Bind the arrow key to a function | |
| This command binds the up arrow key to the HistorySearchBackward function. This function searches command history for command lines that start with the current contents of the command line. | |
| PowerShell | |
| Copy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define the types to export with type accelerators. | |
| $ExportableTypes =@( | |
| [DefinedTypeName] | |
| ) | |
| # Get the internal TypeAccelerators class to use its static methods. | |
| $TypeAcceleratorsClass = [psobject].Assembly.GetType( | |
| 'System.Management.Automation.TypeAccelerators' | |
| ) | |
| # Ensure none of the types would clobber an existing type accelerator. | |
| # If a type accelerator with the same name exists, throw an exception. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm config set proxy=http://127.0.0.1:7890 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 利用flask简单做一个API 网页 | |
| 1. | |
| pip install flask | |
| 2. | |
| from flask import Flask | |
| import subprocess | |
| app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.sudo apt install python3.12-venv | |
| 2.python3 -m venv /var/www/server/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python 3 | |
| python3 -m http.server 8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pip install pyinstaller | |
| pyinstaller --onefile main.py |