add new chinese translations
This commit is contained in:
20
pages.zh/windows/add-appxpackage.md
Normal file
20
pages.zh/windows/add-appxpackage.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# 添加-AppxPackage
|
||||
|
||||
> 一个 PowerShell 工具,用于将一个签名的应用包(`.appx`、`.msix`、`.appxbundle` 和 `.msixbundle`)添加到用户帐户中。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/appx/Add-AppxPackage>。
|
||||
|
||||
- 添加一个应用包:
|
||||
|
||||
`Add-AppxPackage -Path {{path\to\package.msix}}`
|
||||
|
||||
- 添加一个具有依赖关系的应用包:
|
||||
|
||||
`Add-AppxPackage -Path {{path\to\package.msix}} -DependencyPath {{path\to\dependencies.msix}}`
|
||||
|
||||
- 使用应用安装程序文件安装应用:
|
||||
|
||||
`Add-AppxPackage -AppInstallerFile {{path\to\app.appinstaller}}`
|
||||
|
||||
- 添加一个未签名的包:
|
||||
|
||||
`Add-AppxPackage -Path {{path\to\package.msix}} -DependencyPath {{path\to\dependencies.msix}} -AllowUnsigned`
|
@@ -1,16 +1,20 @@
|
||||
# assoc
|
||||
|
||||
> 显示或修改文件扩展名关联。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/assoc>.
|
||||
> 显示或更改文件扩展名与文件类型之间的关联。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/assoc>。
|
||||
|
||||
- 显示所有当前文件扩展名关联的列表:
|
||||
- 列出所有文件扩展名与文件类型之间的关联:
|
||||
|
||||
`assoc`
|
||||
|
||||
- 显示指定扩展名的关联文件类型:
|
||||
- 显示特定扩展名的关联文件类型:
|
||||
|
||||
`assoc {{.txt}}`
|
||||
|
||||
- 将文件扩展名与特定的文件类型关联:
|
||||
- 设置特定扩展名的关联文件类型:
|
||||
|
||||
`assoc {{.txt}}={{txtfile}}`
|
||||
`assoc .{{txt}}={{txtfile}}`
|
||||
|
||||
- 逐屏查看 `assoc` 的输出:
|
||||
|
||||
`assoc | {{more}}`
|
@@ -1,8 +1,28 @@
|
||||
# attrib
|
||||
|
||||
> 显示或修改文件和目录的属性。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/attrib>.
|
||||
> 显示或更改文件或目录的属性。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/attrib>。
|
||||
|
||||
- 显示当前目录下所有文件的属性:
|
||||
- 显示当前目录中所有设置的文件属性:
|
||||
|
||||
`attrib`
|
||||
|
||||
- 显示特定目录中所有设置的文件属性:
|
||||
|
||||
`attrib {{path\to\directory}}`
|
||||
|
||||
- 显示当前目录中所有设置的文件和[d]irectory属性:
|
||||
|
||||
`attrib /d`
|
||||
|
||||
- 显示当前目录及其[s]ub-directory中所有设置的文件属性:
|
||||
|
||||
`attrib /s`
|
||||
|
||||
- 将`[r]ead-only`或`[a]rchive`或`[s]ystem`或`[h]idden`或`not content [i]ndexed`属性添加到文件或目录:
|
||||
|
||||
`attrib +{{r|a|s|h|i}} {{path\to\file_or_directory1 path\to\file_or_directory2 ...}}`
|
||||
|
||||
- 移除文件或目录的特定属性:
|
||||
|
||||
`attrib -{{r|a|s|h|i}} {{path\to\file_or_directory1 path\to\file_or_directory2 ...}}`
|
28
pages.zh/windows/azcopy.md
Normal file
28
pages.zh/windows/azcopy.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# azcopy
|
||||
|
||||
> 一个用于上传到 Azure 云存储账户的文件传输工具。
|
||||
> 更多信息:<https://learn.microsoft.com/azure/storage/common/storage-use-azcopy-v10>。
|
||||
|
||||
- 登录到 Azure 租户:
|
||||
|
||||
`azcopy login`
|
||||
|
||||
- 上传本地文件:
|
||||
|
||||
`azcopy copy '{{path\to\source_file}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}/{{blob_name}}'`
|
||||
|
||||
- 上传扩展名为 `.txt` 和 `.jpg` 的文件:
|
||||
|
||||
`azcopy copy '{{path\to\source_directory}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}' --include-pattern '{{*.txt;*.jpg}}'`
|
||||
|
||||
- 在两个 Azure 存储账户之间直接复制容器:
|
||||
|
||||
`azcopy copy 'https://{{source_storage_account_name}}.blob.core.windows.net/{{container_name}}' 'https://{{destination_storage_account_name}}.blob.core.windows.net/{{container_name}}'`
|
||||
|
||||
- 同步本地目录,并在目标中删除源中不存在的文件:
|
||||
|
||||
`azcopy sync '{{path\to\source_directory}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}' --recursive --delete-destination=true`
|
||||
|
||||
- 显示帮助信息:
|
||||
|
||||
`azcopy --help`
|
24
pages.zh/windows/bcdboot.md
Normal file
24
pages.zh/windows/bcdboot.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# bcdboot
|
||||
|
||||
> 配置或修复启动文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-hardware/manufacture/desktop/bcdboot-command-line-options-techref-di>。
|
||||
|
||||
- 使用源Windows文件夹中的BCD文件初始化系统分区:
|
||||
|
||||
`bcdboot {{C:\Windows}}`
|
||||
|
||||
- 启用 [v]erbose 模式:
|
||||
|
||||
`bcdboot {{C:\Windows}} /v`
|
||||
|
||||
- 指定 [s]ystem 分区的卷标:
|
||||
|
||||
`bcdboot {{C:\Windows}} /s {{S:}}`
|
||||
|
||||
- 指定 [l]ocale:
|
||||
|
||||
`bcdboot {{C:\Windows}} /l {{en-us}}`
|
||||
|
||||
- 在将启动文件复制到指定卷时指定 [f]irmware 类型:
|
||||
|
||||
`bcdboot {{C:\Windows}} /s {{S:}} /f {{UEFI|BIOS|ALL}}`
|
7
pages.zh/windows/bleachbit.md
Normal file
7
pages.zh/windows/bleachbit.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# bleachbit
|
||||
|
||||
> 此命令是 `bleachbit_console` 的别名。
|
||||
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr bleachbit_console`
|
24
pages.zh/windows/bleachbit_console.md
Normal file
24
pages.zh/windows/bleachbit_console.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# bleachbit_console
|
||||
|
||||
> 清理文件系统中的垃圾文件。
|
||||
> 更多信息:<https://docs.bleachbit.org/doc/command-line-interface.html>。
|
||||
|
||||
- 启动Bleachbit的图形用户界面(GUI)版本:
|
||||
|
||||
`bleachbit_console.exe --gui`
|
||||
|
||||
- 切碎一个文件:
|
||||
|
||||
`bleachbit_console.exe --shred {{path/to/file}}`
|
||||
|
||||
- 列出可用的清理选项:
|
||||
|
||||
`bleachbit_console.exe --list-cleaners`
|
||||
|
||||
- 在实际执行清理操作之前,预览将被删除的文件和其他将进行的更改:
|
||||
|
||||
`bleachbit_console.exe --preview {{--preset|cleaner1.option1 cleaner2.* ...}}`
|
||||
|
||||
- 执行清理操作并删除文件:
|
||||
|
||||
`bleachbit_console.exe --clean {{--preset|cleaner1.option1 cleaner2.* ...}}`
|
33
pages.zh/windows/cd.md
Normal file
33
pages.zh/windows/cd.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# cd
|
||||
|
||||
> 显示当前工作目录或移动到不同的目录。
|
||||
> 在 PowerShell 中,此命令是 `Set-Location` 的别名。本文件基于命令提示符(`cmd`)版本的 `cd`。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cd>。
|
||||
|
||||
- 查看等效 PowerShell 命令的文档:
|
||||
|
||||
`tldr set-location`
|
||||
|
||||
- 显示当前目录的路径:
|
||||
|
||||
`cd`
|
||||
|
||||
- 前往同一驱动器中的特定目录:
|
||||
|
||||
`cd {{path\to\directory}}`
|
||||
|
||||
- 前往不同 [d] 驱动器中的特定目录:
|
||||
|
||||
`cd /d {{C}}:{{path\to\directory}}`
|
||||
|
||||
- 返回当前目录的父目录:
|
||||
|
||||
`cd ..`
|
||||
|
||||
- 前往当前用户的主目录:
|
||||
|
||||
`cd %userprofile%`
|
||||
|
||||
- 前往当前驱动器的根目录:
|
||||
|
||||
`cd \`
|
24
pages.zh/windows/certutil.md
Normal file
24
pages.zh/windows/certutil.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# certutil
|
||||
|
||||
> 这是一个用于管理和配置证书信息的工具。
|
||||
> 更多信息请访问:<https://learn.microsoft.com/windows-server/administration/windows-commands/certutil>。
|
||||
|
||||
- 转储配置文件或信息:
|
||||
|
||||
`certutil {{filename}}`
|
||||
|
||||
- 以十六进制编码文件:
|
||||
|
||||
`certutil -encodehex {{path\to\input_file}} {{path\to\output_file}}`
|
||||
|
||||
- 将文件编码为Base64:
|
||||
|
||||
`certutil -encode {{path\to\input_file}} {{path\to\output_file}}`
|
||||
|
||||
- 解码Base64编码的文件:
|
||||
|
||||
`certutil -decode {{path\to\input_file}} {{path\to\output_file}}`
|
||||
|
||||
- 生成并显示文件的加密哈希值:
|
||||
|
||||
`certutil -hashfile {{path\to\input_file}} {{md2|md4|md5|sha1|sha256|sha384|sha512}}`
|
12
pages.zh/windows/chdir.md
Normal file
12
pages.zh/windows/chdir.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# chdir
|
||||
|
||||
> 此命令是命令提示符中的 `cd` 的别名,随后在 PowerShell 中为 `Set-Location`。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/chdir>。
|
||||
|
||||
- 查看原始命令提示符命令的文档:
|
||||
|
||||
`tldr cd`
|
||||
|
||||
- 查看原始 PowerShell 命令的文档:
|
||||
|
||||
`tldr set-location`
|
20
pages.zh/windows/chkdsk.md
Normal file
20
pages.zh/windows/chkdsk.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# chkdsk
|
||||
|
||||
> 检查文件系统和卷元数据中的错误。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/chkdsk>。
|
||||
|
||||
- 指定要检查的驱动器字母(后跟冒号)、挂载点或卷名称:
|
||||
|
||||
`chkdsk {{volume}}`
|
||||
|
||||
- 修复特定卷上的错误:
|
||||
|
||||
`chkdsk {{volume}} /f`
|
||||
|
||||
- 在检查之前卸载特定卷:
|
||||
|
||||
`chkdsk {{volume}} /x`
|
||||
|
||||
- 将日志文件大小更改为指定大小(仅适用于NTFS):
|
||||
|
||||
`chkdsk /l{{size}}`
|
20
pages.zh/windows/choco-apikey.md
Normal file
20
pages.zh/windows/choco-apikey.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# choco apikey
|
||||
|
||||
> 管理 Chocolatey 源的 API 密钥。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-apikey>。
|
||||
|
||||
- 显示源及其 API 密钥的列表:
|
||||
|
||||
`choco apikey`
|
||||
|
||||
- 显示特定源及其 API 密钥:
|
||||
|
||||
`choco apikey --source "{{source_url}}"`
|
||||
|
||||
- 为源设置 API 密钥:
|
||||
|
||||
`choco apikey --source "{{source_url}}" --key "{{api_key}}"`
|
||||
|
||||
- 移除源的 API 密钥:
|
||||
|
||||
`choco apikey --source "{{source_url}}" --remove`
|
@@ -1,16 +1,16 @@
|
||||
# choco feature
|
||||
# choco 功能
|
||||
|
||||
> Chocolatey 的交互功能。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-feature>.
|
||||
> 与 Chocolatey 的功能进行交互。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-feature>。
|
||||
|
||||
- 显示可用的功能列表:
|
||||
- 显示可用功能的列表:
|
||||
|
||||
`choco feature list`
|
||||
|
||||
- 启用一个功能:
|
||||
- 启用功能:
|
||||
|
||||
`choco feature enable --name {{功能名称}}`
|
||||
`choco feature enable --name {{name}}`
|
||||
|
||||
- 禁用一个功能:
|
||||
- 禁用功能:
|
||||
|
||||
`choco feature disable --name {{功能名称}}`
|
||||
`choco feature disable --name {{name}}`
|
@@ -1,20 +1,20 @@
|
||||
# choco info
|
||||
# choco 信息
|
||||
|
||||
> 显示有关 Chocolatey 包的详细信息。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-info>.
|
||||
> 显示有关 Chocolatey 软件包的详细信息。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-info>。
|
||||
|
||||
- 显示指定包的信息:
|
||||
- 显示特定软件包的信息:
|
||||
|
||||
`choco info {{包名}}`
|
||||
`choco info {{package}}`
|
||||
|
||||
- 显示一个本地已安装包的信息:
|
||||
- 仅显示本地软件包的信息:
|
||||
|
||||
`choco info {{包名}} --local-only`
|
||||
`choco info {{package}} --local-only`
|
||||
|
||||
- 从一个自定义的源来获取包的信息:
|
||||
- 指定自定义源以获取软件包信息:
|
||||
|
||||
`choco info {{包名}} --source {{源 URL|别名}}`
|
||||
`choco info {{package}} --source {{source_url|alias}}`
|
||||
|
||||
- 提供一个用户名和密码来进行验证:
|
||||
- 提供用户名和密码进行身份验证:
|
||||
|
||||
`choco info {{包名}} --user {{用户名}} --password {{密码}}`
|
||||
`choco info {{package}} --user {{username}} --password {{password}}`
|
@@ -1,36 +1,36 @@
|
||||
# choco install
|
||||
# choco 安装
|
||||
|
||||
> 使用 Chocolatey 下载一个或多个包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-install>.
|
||||
> 使用 Chocolatey 安装一个或多个软件包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-install>。
|
||||
|
||||
- 安装一个或多个用空格分隔的软件包:
|
||||
- 安装一个或多个软件包:
|
||||
|
||||
`choco install {{包名 包名 ..}}`
|
||||
`choco install {{package1 package2 ...}}`
|
||||
|
||||
- 从一个自定义的配置文件中安装包:
|
||||
- 从自定义配置文件安装软件包:
|
||||
|
||||
`choco install {{配置文件的路径}}`
|
||||
`choco install {{path\to\packages_file.config}}`
|
||||
|
||||
- 安装一个特定的 "nuspec" 或 "nupkg" 文件:
|
||||
- 安装特定的 `nuspec` 或 `nupkg` 文件:
|
||||
|
||||
`choco install {{文件的路径}}`
|
||||
`choco install {{path\to\file}}`
|
||||
|
||||
- 安装一个指定版本的包:
|
||||
- 安装软件包的特定版本:
|
||||
|
||||
`choco install {{包名}} --version {{版本号}}`
|
||||
`choco install {{package}} --version {{version}}`
|
||||
|
||||
- 允许安装一个包的多个版本:
|
||||
- 允许安装软件包的多个版本:
|
||||
|
||||
`choco install {{包名}} --allow-multiple`
|
||||
`choco install {{package}} --allow-multiple`
|
||||
|
||||
- 自动确认所有提示:
|
||||
|
||||
`choco install {{包名}} --yes`
|
||||
`choco install {{package}} --yes`
|
||||
|
||||
- 从自定义的源处获取包:
|
||||
- 指定一个自定义源以接收软件包:
|
||||
|
||||
`choco install {{包名}} --source {{源 URL|别名}}`
|
||||
`choco install {{package}} --source {{source_url|alias}}`
|
||||
|
||||
- 提供一个用户名和密码来进行验证:
|
||||
- 提供用户名和密码进行身份验证:
|
||||
|
||||
`choco install {{包名}} --user {{用户名}} --password {{密码}}`
|
||||
`choco install {{package}} --user {{username}} --password {{password}}`
|
@@ -1,28 +1,28 @@
|
||||
# choco list
|
||||
# choco 列表
|
||||
|
||||
> 使用 Chocolatey 显示包列表。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-list>.
|
||||
> 显示 Chocolatey 的软件包列表。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-list>。
|
||||
|
||||
- 列出所有可用的包:
|
||||
- 显示所有可用的软件包:
|
||||
|
||||
`choco list`
|
||||
|
||||
- 列出所有本地已安装的包:
|
||||
- 显示所有本地安装的软件包:
|
||||
|
||||
`choco list --local-only`
|
||||
|
||||
- 显示包含本地程序的列表:
|
||||
- 显示包括本地程序在内的列表:
|
||||
|
||||
`choco list --include-programs`
|
||||
|
||||
- 只显示已批准的包:
|
||||
- 仅显示已批准的软件包:
|
||||
|
||||
`choco list --approved-only`
|
||||
|
||||
- Specify a custom source to display packages from 指定一个源来显示包列表:
|
||||
- 指定自定义源以显示软件包:
|
||||
|
||||
`choco list --source {{源 URL|别名}}`
|
||||
`choco list --source {{source_url|alias}}`
|
||||
|
||||
- 提供一个用户名和密码来进行验证:
|
||||
- 提供用户名和密码进行身份验证:
|
||||
|
||||
`choco list --user {{用户名}} --password {{密码}}`
|
||||
`choco list --user {{username}} --password {{password}}`
|
@@ -1,24 +1,24 @@
|
||||
# choco new
|
||||
|
||||
> 使用 Chocolatey 生成新的包规范文件。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-new>.
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-new>。
|
||||
|
||||
- 创建一个新的包框架:
|
||||
- 创建一个新的包骨架:
|
||||
|
||||
`choco new {{包名}}`
|
||||
`choco new {{package}}`
|
||||
|
||||
- 创建一个新的指定版本的包:
|
||||
- 创建一个具有特定版本的新包:
|
||||
|
||||
`choco new {{包名}} --version {{版本号}}`
|
||||
`choco new {{package}} --version {{version}}`
|
||||
|
||||
- 创建一个新的包并指定维护者的名字:
|
||||
- 创建一个具有特定维护者名称的新包:
|
||||
|
||||
`choco new {{包名}} --maintainer {{维护者名字}}`
|
||||
`choco new {{package}} --maintainer {{maintainer_name}}`
|
||||
|
||||
- 在指定目录下创建新的包:
|
||||
- 在自定义输出目录中创建一个新包:
|
||||
|
||||
`choco new {{包名}} --output-directory {{指定的目录路径}}`
|
||||
`choco new {{package}} --output-directory {{path/to/directory}}`
|
||||
|
||||
- 创建一个新的包并指定其 32 位版和 64 位版的安装 URL:
|
||||
- 创建一个具有特定 32 位和 64 位安装程序 URL 的新包:
|
||||
|
||||
`choco new {{package_name}} url="{{url}}" url64="{{url}}"`
|
||||
`choco new {{package}} url="{{url}}" url64="{{url}}"`
|
@@ -1,20 +1,20 @@
|
||||
# choco outdated
|
||||
# choco 过期
|
||||
|
||||
> 使用 Chocolatey 检查过时的包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-outdated>.
|
||||
> 使用 Chocolatey 检查过期的软件包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-outdated>。
|
||||
|
||||
- 用表格的形式列出过时的包:
|
||||
- 以表格格式显示过期软件包的列表:
|
||||
|
||||
`choco outdated`
|
||||
|
||||
- 忽略输出中的固定包:
|
||||
- 在输出中忽略已固定的软件包:
|
||||
|
||||
`choco outdated --ignore-pinned`
|
||||
|
||||
- 从自定义的源处检查过时的包:
|
||||
- 指定自定义源以检查软件包:
|
||||
|
||||
`choco outdated --source {{源 URL|别名}}`
|
||||
`choco outdated --source {{source_url|alias}}`
|
||||
|
||||
- 提供一个用户名和密码来进行验证:
|
||||
- 提供用户名和密码进行身份验证:
|
||||
|
||||
`choco outdated --user {{用户名}} --password {{密码}}`
|
||||
`choco outdated --user {{username}} --password {{password}}`
|
@@ -1,16 +1,16 @@
|
||||
# choco pack
|
||||
|
||||
> 将 nuspec 打包到已编译的 nupkg.
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-pack>.
|
||||
> 将 NuGet 规范打包为 `nupkg` 文件。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-pack>。
|
||||
|
||||
- 将 nuspec 打包到已编译的 nupkg:
|
||||
- 将 NuGet 规范打包为 `nupkg` 文件:
|
||||
|
||||
`choco pack {{nuspec 的路径}}`
|
||||
`choco pack {{path\to\specification_file}}`
|
||||
|
||||
- 将 nuspec 打包到已编译的 nupkg, 并指定生成的版本:
|
||||
- 打包 NuGet 规范并指定生成文件的版本:
|
||||
|
||||
`choco pack {{nuspec 的路径}} --version {{版本号}}`
|
||||
`choco pack {{path\to\specification_file}} --version {{version}}`
|
||||
|
||||
- 将 nuspec 打包到已编译的 nupkg, 并输出到指定的目录:
|
||||
- 将 NuGet 规范打包到特定目录:
|
||||
|
||||
`choco pack {{nuspec 的路径}} --output-directory {{输出目录的路径}}`
|
||||
`choco pack {{path\to\specification_file}} --output-directory {{path\to\output_directory}}`
|
@@ -1,21 +1,21 @@
|
||||
# choco pin
|
||||
|
||||
> 使用 Chocolatey 将一个包固定到指定的版本。
|
||||
> 被固定版本的包会在更新时自动忽略。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-pin>.
|
||||
> 使用 Chocolatey 将软件包固定在某个版本。
|
||||
> 固定的软件包在升级时会自动被跳过。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-pin>。
|
||||
|
||||
- 显示被固定的包以及他们对应的版本号:
|
||||
- 显示固定软件包及其版本的列表:
|
||||
|
||||
`choco pin list`
|
||||
|
||||
- 将一个包固定至当前版本:
|
||||
- 将软件包固定在其当前版本:
|
||||
|
||||
`choco pin add --name {{包名}}`
|
||||
`choco pin add --name {{package}}`
|
||||
|
||||
- 将一个包固定直指定的版本:
|
||||
- 将软件包固定在特定版本:
|
||||
|
||||
`choco pin add --name {{包名}} --version {{版本号}}`
|
||||
`choco pin add --name {{package}} --version {{version}}`
|
||||
|
||||
- 移除指定包的固定状态:
|
||||
- 移除特定软件包的固定:
|
||||
|
||||
`choco pin remove --name {{包名}}`
|
||||
`choco pin remove --name {{package}}`
|
12
pages.zh/windows/choco-push.md
Normal file
12
pages.zh/windows/choco-push.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# choco-push
|
||||
|
||||
> 将已编译的 NuGet 包(`nupkg`)推送到包源。
|
||||
> 更多信息:<https://docs.chocolatey.org/en-us/create/commands/push>。
|
||||
|
||||
- 将已编译的 `nupkg` 推送到指定的源:
|
||||
|
||||
`choco push --source {{https://push.chocolatey.org/}}`
|
||||
|
||||
- 将已编译的 `nupkg` 推送到指定的源,并设置超时时间(单位:秒,默认值为 2700):
|
||||
|
||||
`choco push --source {{https://push.chocolatey.org/}} --execution-timeout {{500}}`
|
@@ -1,28 +1,28 @@
|
||||
# choco search
|
||||
|
||||
> 使用 Chocolatey 搜索一个本地或远程的包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-search>.
|
||||
> 使用 Chocolatey 搜索本地或远程软件包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-search>。
|
||||
|
||||
- 搜索一个包:
|
||||
- 搜索软件包:
|
||||
|
||||
`choco search {{查询语句}}`
|
||||
`choco search {{query}}`
|
||||
|
||||
- 搜索一个本地的包:
|
||||
- 本地搜索软件包:
|
||||
|
||||
`choco search {{查询语句}} --local-only`
|
||||
`choco search {{query}} --local-only`
|
||||
|
||||
- 只显示包含完全匹配的结果:
|
||||
- 仅包含完全匹配的结果:
|
||||
|
||||
`choco search {{查询语句}} --exact`
|
||||
`choco search {{query}} --exact`
|
||||
|
||||
- 自动确认所有提示:
|
||||
|
||||
`choco search {{查询语句}} --yes`
|
||||
`choco search {{query}} --yes`
|
||||
|
||||
- 从自定义的源处搜索包:
|
||||
- 指定一个自定义源以搜索软件包:
|
||||
|
||||
`choco search {{查询语句}} --source {{源 URL|别名}}`
|
||||
`choco search {{query}} --source {{source_url|alias}}`
|
||||
|
||||
- 提供一个用户名和密码来进行验证:
|
||||
- 提供用户名和密码进行身份验证:
|
||||
|
||||
`choco search {{查询语句}} --user {{用户名}} --password {{密码}}`
|
||||
`choco search {{query}} --user {{username}} --password {{password}}`
|
@@ -1,32 +1,32 @@
|
||||
# choco source
|
||||
# choco 源
|
||||
|
||||
> 使用 Chocolatey 管理包的源。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-source>.
|
||||
> 管理 Chocolatey 的软件包源。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands/source>。
|
||||
|
||||
- 列出当前可用的源:
|
||||
|
||||
`choco source list`
|
||||
|
||||
- 添加一个新的包源:
|
||||
- 添加一个新的软件包源:
|
||||
|
||||
`choco source add --name {{名称}} --source {{url}}`
|
||||
`choco source add --name {{name}} --source {{url}}`
|
||||
|
||||
- 添加包含凭据的新包源:
|
||||
- 添加一个带有凭据的新软件包源:
|
||||
|
||||
`choco source add --name {{名称}} --source {{url}} --user {{用户名}} --password {{密码}}`
|
||||
`choco source add --name {{name}} --source {{url}} --user {{username}} --password {{password}}`
|
||||
|
||||
- 使用客户端证书添加新的包源:
|
||||
- 添加一个带有客户端证书的新软件包源:
|
||||
|
||||
`choco source add --name {{名称}} --source {{url}} --cert {{证书的路径}}`
|
||||
`choco source add --name {{name}} --source {{url}} --cert {{path\to\certificate_file}}`
|
||||
|
||||
- 启用一个包源:
|
||||
- 启用一个软件包源:
|
||||
|
||||
`choco source enable --name {{名称}}`
|
||||
`choco source enable --name {{name}}`
|
||||
|
||||
- 禁用一个包源:
|
||||
- 禁用一个软件包源:
|
||||
|
||||
`choco source disable --name {{名称}}`
|
||||
`choco source disable --name {{name}}`
|
||||
|
||||
- 移除一个包源:
|
||||
- 移除一个软件包源:
|
||||
|
||||
`choco source remove --name {{名称}}`
|
||||
`choco source remove --name {{name}}`
|
@@ -1,24 +1,24 @@
|
||||
# choco uninstall
|
||||
# choco 卸载
|
||||
|
||||
> 使用 Chocolatey 卸载一个或多个包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-uninstall>.
|
||||
> 使用 Chocolatey 卸载软件包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-uninstall>。
|
||||
|
||||
- 卸载一个或多个用空格分隔的软件包:
|
||||
- 卸载一个或多个软件包:
|
||||
|
||||
`choco uninstall {{包名 『包名』 ..}}`
|
||||
`choco 卸载 {{package1 package2 ...}}`
|
||||
|
||||
- 卸载一个指定版本的包:
|
||||
- 卸载特定版本的软件包:
|
||||
|
||||
`choco uninstall {{包名}} --version {{版本号}}`
|
||||
`choco 卸载 {{package}} --version {{version}}`
|
||||
|
||||
- 自动确认所有提示:
|
||||
|
||||
`choco uninstall {{包名}} --yes`
|
||||
`choco 卸载 {{package}} --yes`
|
||||
|
||||
- 卸载时同时删除其所有的依赖:
|
||||
- 卸载时移除所有依赖项:
|
||||
|
||||
`choco uninstall {{包名}} --remove-dependencies`
|
||||
`choco 卸载 {{package}} --remove-dependencies`
|
||||
|
||||
- 卸载全部包:
|
||||
- 卸载所有软件包:
|
||||
|
||||
`choco uninstall all`
|
||||
`choco 卸载 all`
|
@@ -1,32 +1,32 @@
|
||||
# choco upgrade
|
||||
# choco 升级
|
||||
|
||||
> 使用 Chocolatey 升级一个或多个包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-upgrade>.
|
||||
> 使用 Chocolatey 升级一个或多个软件包。
|
||||
> 更多信息:<https://chocolatey.org/docs/commands-upgrade>。
|
||||
|
||||
- 升级一个或多个用空格分隔的软件包:
|
||||
- 升级一个或多个软件包:
|
||||
|
||||
`choco upgrade {{包名 包名 ..}}`
|
||||
`choco upgrade {{package1 package2 ...}}`
|
||||
|
||||
- 将一个包升级到指定版本:
|
||||
- 升级到特定版本的软件包:
|
||||
|
||||
`choco upgrade {{包名}} --version {{版本号}}`
|
||||
`choco upgrade {{package}} --version {{version}}`
|
||||
|
||||
- 升级全部包:
|
||||
- 升级所有软件包:
|
||||
|
||||
`choco upgrade all`
|
||||
|
||||
- 升级除指定的用逗号分隔的包之外的所有包:
|
||||
- 升级所有软件包,但排除指定的以逗号分隔的软件包:
|
||||
|
||||
`choco upgrade all --except "{{包名 , 包名 ..}}"`
|
||||
`choco upgrade all --except "{{package1,package2,...}}"`
|
||||
|
||||
- 自动确认所有提示:
|
||||
|
||||
`choco upgrade {{包名}} --yes`
|
||||
`choco upgrade {{package}} --yes`
|
||||
|
||||
- 从自定义源处升级包:
|
||||
- 指定一个自定义源以接收软件包:
|
||||
|
||||
`choco upgrade {{包名}} --source {{源 URL|别名}}`
|
||||
`choco upgrade {{package}} --source {{source_url|alias}}`
|
||||
|
||||
- 提供一个用户名和密码来进行验证:
|
||||
- 提供用户名和密码进行身份验证:
|
||||
|
||||
`choco upgrade {{包}} --user {{用户名}} --password {{密码}}`
|
||||
`choco upgrade {{package}} --user {{username}} --password {{password}}`
|
@@ -1,21 +1,21 @@
|
||||
# choco
|
||||
|
||||
> Chocolatey 包管理器的命令行界面。
|
||||
> 此命令也有关于其子命令的文件,例如:`install`.
|
||||
> 更多信息:<https://chocolatey.org>.
|
||||
> Chocolatey 包管理器。
|
||||
> 一些子命令,例如 `install`,有自己的使用文档。
|
||||
> 更多信息:<https://chocolatey.org>。
|
||||
|
||||
- 执行 Chocolatey 命令:
|
||||
|
||||
`choco {{命令}}`
|
||||
`choco {{command}}`
|
||||
|
||||
- 显示基本的帮助页面:
|
||||
- 显示帮助:
|
||||
|
||||
`choco -?`
|
||||
|
||||
- 显示指定命令的帮助页面:
|
||||
- 显示特定命令的帮助:
|
||||
|
||||
`choco {{命令}} -?`
|
||||
`choco {{command}} -?`
|
||||
|
||||
- 显示 Chocolatey 的版本:
|
||||
- 显示版本:
|
||||
|
||||
`choco --version`
|
||||
`choco --version`
|
28
pages.zh/windows/choice.md
Normal file
28
pages.zh/windows/choice.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# 选择
|
||||
|
||||
> 提示用户选择一个选项并返回所选选项的索引。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/choice>。
|
||||
|
||||
- 提示当前用户选择 `Y` 或 `N` 选项:
|
||||
|
||||
`choice`
|
||||
|
||||
- 提示当前用户从特定集合中选择一个 [c]hoice:
|
||||
|
||||
`choice /c {{AB}}`
|
||||
|
||||
- 提示当前用户选择一个带有特定 [m]essage 的选项:
|
||||
|
||||
`choice /m "{{message}}"`
|
||||
|
||||
- 提示当前用户从特定集合中选择一个 [c]ase-[s]ensitive [c]hoice:
|
||||
|
||||
`choice /cs /c {{Ab}}`
|
||||
|
||||
- 提示当前用户选择一个选项,并在特定 [t]ime 内优先选择 [d]efault 选项:
|
||||
|
||||
`choice /t {{5}} /d {{N}}`
|
||||
|
||||
- 显示帮助:
|
||||
|
||||
`choice /?`
|
@@ -1,8 +1,8 @@
|
||||
# chrome
|
||||
|
||||
> 这是 `chromium` 命令的一个别名。
|
||||
> 更多信息:<https://chrome.google.com>.
|
||||
> 此命令是 `chromium` 的别名。
|
||||
> 更多信息请访问: <https://chrome.google.com>。
|
||||
|
||||
- 原命令的文档在:
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr chromium`
|
||||
`tldr chromium`
|
37
pages.zh/windows/chromium.md
Normal file
37
pages.zh/windows/chromium.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# chromium
|
||||
|
||||
> 由谷歌主要开发和维护的开源网络浏览器。
|
||||
> 注意:您可能需要将 `chromium` 命令替换为您所需的网络浏览器,例如 `brave`、`google-chrome`、`microsoft-edge`/`msedge`、`opera` 或 `vivaldi`。
|
||||
> 更多信息:<https://www.chromium.org/developers/how-tos/run-chromium-with-flags/>.
|
||||
|
||||
- 打开特定的 URL 或文件:
|
||||
|
||||
`chromium {{https://example.com|path/to/file.html}}`
|
||||
|
||||
- 在隐身模式下打开(对于 Microsoft Edge 使用 `--inprivate`):
|
||||
|
||||
`{{chromium --incognito|msedge --inprivate}} {{example.com}}`
|
||||
|
||||
- 在新窗口中打开:
|
||||
|
||||
`chromium --new-window {{example.com}}`
|
||||
|
||||
- 以应用模式打开(没有工具栏、URL栏、按钮等):
|
||||
|
||||
`chromium --app={{https://example.com}}`
|
||||
|
||||
- 使用代理服务器:
|
||||
|
||||
`chromium --proxy-server="{{socks5://hostname:66}}" {{example.com}}`
|
||||
|
||||
- 使用自定义配置文件目录打开:
|
||||
|
||||
`chromium --user-data-dir={{path/to/directory}}`
|
||||
|
||||
- 在没有 CORS 验证的情况下打开(用于测试 API 很有用):
|
||||
|
||||
`chromium --user-data-dir={{path/to/directory}} --disable-web-security`
|
||||
|
||||
- 为每个打开的标签页打开一个 DevTools 窗口:
|
||||
|
||||
`chromium --auto-open-devtools-for-tabs`
|
@@ -1,7 +1,7 @@
|
||||
# cinst
|
||||
|
||||
> 这是 `choco install` 命令的一个别名。
|
||||
> 此命令是 `choco install` 的别名。
|
||||
|
||||
- 原命令的文档在:
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr choco install`
|
||||
`tldr choco install`
|
@@ -1,16 +1,20 @@
|
||||
# cipher
|
||||
|
||||
> 加密或解密 NTFS 驱动器上的文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cipher>.
|
||||
> 显示或更改 NTFS 卷上目录和文件的加密。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cipher>。
|
||||
|
||||
- 加密文件或目录:
|
||||
- 显示特定加密文件或目录的信息:
|
||||
|
||||
`cipher /e:{{路径/文件或目录}}`
|
||||
`cipher /c:{{path\to\file_or_directory}}`
|
||||
|
||||
- 解密文件或目录:
|
||||
- [e]ncrypt(加密)一个文件或目录(后来添加到该目录的文件也会被加密,因为该目录已被标记为加密):
|
||||
|
||||
`cipher /d:{{路径/文件或目录}}`
|
||||
`cipher /e:{{path\to\file_or_directory}}`
|
||||
|
||||
- 安全地删除文件或目录:
|
||||
- [d]ecrypt(解密)一个文件或目录:
|
||||
|
||||
`cipher /w:{{路径/文件或目录}}`
|
||||
`cipher /d:{{path\to\file_or_directory}}`
|
||||
|
||||
- 安全地删除一个文件或目录:
|
||||
|
||||
`cipher /w:{{path\to\file_or_directory}}`
|
9
pages.zh/windows/clear-host.md
Normal file
9
pages.zh/windows/clear-host.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# 清除主机
|
||||
|
||||
> 清除屏幕。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.core/clear-host>。
|
||||
|
||||
- 清除屏幕:
|
||||
|
||||
`cls`
|
17
pages.zh/windows/clear-recyclebin.md
Normal file
17
pages.zh/windows/clear-recyclebin.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 清空回收站
|
||||
|
||||
> 从回收站中清除项目。
|
||||
> 此命令仅可通过 PowerShell 版本 5.1 及以下或 7.1 及以上使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin>。
|
||||
|
||||
- 清空并删除回收站内的所有项目:
|
||||
|
||||
`Clear-RecycleBin`
|
||||
|
||||
- 清空特定驱动器的回收站:
|
||||
|
||||
`Clear-RecycleBin -DriveLetter {{C}}`
|
||||
|
||||
- 无需进一步确认清空回收站:
|
||||
|
||||
`Clear-RecycleBin -Force`
|
7
pages.zh/windows/clear.md
Normal file
7
pages.zh/windows/clear.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 清除
|
||||
|
||||
> 在 PowerShell 中,此命令是 `Clear-Host` 的别名。
|
||||
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr clear-host`
|
@@ -1,12 +1,20 @@
|
||||
# clip
|
||||
|
||||
> 将输入的内容复制到 Windows 的剪贴板。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/clip>.
|
||||
> 将输入内容复制到 Windows 剪贴板。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/clip>。
|
||||
|
||||
- 用管道将命令的输出内容复制到 Windows 剪贴板:
|
||||
- 将命令行输出通过管道发送到 Windows 剪贴板:
|
||||
|
||||
`{{dir}} | clip`
|
||||
|
||||
- 将一个文件中的内容复制到 Windows 剪贴板:
|
||||
- 将文件的内容复制到 Windows 剪贴板:
|
||||
|
||||
`clip < {{文件的路径}}`
|
||||
`clip < {{path\to\file.ext}}`
|
||||
|
||||
- 将带有换行符的文本复制到 Windows 剪贴板:
|
||||
|
||||
`echo {{some text}} | clip`
|
||||
|
||||
- 将不带换行符的文本复制到 Windows 剪贴板:
|
||||
|
||||
`echo | set /p="some text" | clip`
|
@@ -1,7 +1,7 @@
|
||||
# clist
|
||||
|
||||
> 这是 `choco list` 命令的一个别名。
|
||||
> 此命令是 `choco list` 的别名。
|
||||
|
||||
- 原命令的文档在:
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr choco list`
|
||||
`tldr choco list`
|
@@ -1,8 +1,13 @@
|
||||
# cls
|
||||
|
||||
> 清屏。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cls>.
|
||||
> 清除屏幕。
|
||||
> 在 PowerShell 中,此命令是 `Clear-Host` 的别名。此文档基于命令提示符(`cmd`)版本的 `cls`。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cls>。
|
||||
|
||||
- 清屏:
|
||||
- 查看等效 PowerShell 命令的文档:
|
||||
|
||||
`cls`
|
||||
`tldr clear-host`
|
||||
|
||||
- 清除屏幕:
|
||||
|
||||
`cls`
|
@@ -1,32 +1,36 @@
|
||||
# cmd
|
||||
|
||||
> Windows 命令解释器。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cmd>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cmd>。
|
||||
|
||||
- 开启一个新的命令行实例:
|
||||
- 启动一个交互式 shell 会话:
|
||||
|
||||
`cmd`
|
||||
|
||||
- 运行指定的命令然后退出:
|
||||
- 执行特定的 [c]ommands:
|
||||
|
||||
`cmd /c {{echo 命令}}`
|
||||
`cmd /c {{echo Hello world}}`
|
||||
|
||||
- 执行一个指定的命令,之后进入一个交互式 shell:
|
||||
- 执行特定脚本:
|
||||
|
||||
`cmd /k {{echo 命令}}`
|
||||
`cmd {{path\to\script.bat}}`
|
||||
|
||||
- 不显示命令的输出结果:
|
||||
- 执行特定命令后进入交互式 shell:
|
||||
|
||||
`cmd /k {{echo Hello world}}`
|
||||
|
||||
- 启动一个交互式 shell 会话,命令输出中禁用 `echo`:
|
||||
|
||||
`cmd /q`
|
||||
|
||||
- 启用或禁用环境变量扩展:
|
||||
- 启动一个交互式 shell 会话,启用或禁用延迟 [v]ariable 扩展:
|
||||
|
||||
`cmd /v:{{on|off}}`
|
||||
|
||||
- 启用或禁用命令扩展:
|
||||
- 启动一个交互式 shell 会话,启用或禁用命令 [e]xtensions:
|
||||
|
||||
`cmd /e:{{on|off}}`
|
||||
|
||||
- 强制输出内容使用 Unicode 编码:
|
||||
- 启动一个交互式 shell 会话,使用 [u]nicode 编码:
|
||||
|
||||
`cmd /u`
|
||||
`cmd /u`
|
16
pages.zh/windows/cmdkey.md
Normal file
16
pages.zh/windows/cmdkey.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# cmdkey
|
||||
|
||||
> 创建、显示和删除存储的用户名和密码。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cmdkey>。
|
||||
|
||||
- 列出所有用户凭据:
|
||||
|
||||
`cmdkey /list`
|
||||
|
||||
- 为访问服务器的用户存储凭据:
|
||||
|
||||
`cmdkey /add:{{server_name}} /user:{{user_name}}`
|
||||
|
||||
- 删除特定目标的凭据:
|
||||
|
||||
`cmdkey /delete {{target_name}}`
|
@@ -1,36 +1,36 @@
|
||||
# cmstp
|
||||
|
||||
> 用于管理连接服务配置文件的命令行工具。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cmstp>.
|
||||
> 管理连接服务配置文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/cmstp>。
|
||||
|
||||
- 安装指定的配置文件:
|
||||
- 安装特定配置文件:
|
||||
|
||||
`cmstp "{{配置文件的路径}}"`
|
||||
`cmstp "{{path\to\profile_file}}"`
|
||||
|
||||
- 安装时不创建桌面快捷方式:
|
||||
|
||||
`cmstp /ns "{{配置文件的路径}}"`
|
||||
`cmstp /ns "{{path\to\profile_file}}"`
|
||||
|
||||
- 安装时不检查依赖:
|
||||
- 安装时不检查依赖项:
|
||||
|
||||
`cmstp /nf "{{配置文件的路径}}"`
|
||||
`cmstp /nf "{{path\to\profile_file}}"`
|
||||
|
||||
- 仅为当前用户安装:
|
||||
|
||||
`cmstp /su "{{配置文件的路径}}"`
|
||||
`cmstp /su "{{path\to\profile_file}}"`
|
||||
|
||||
- 为所有用户安装(需要管理员权限):
|
||||
|
||||
`cmstp /au "{{配置文件的路径}}"`
|
||||
`cmstp /au "{{path\to\profile_file}}"`
|
||||
|
||||
- 静默安装:
|
||||
- 安装时静默进行,不显示任何提示:
|
||||
|
||||
`cmstp /s "{{配置文件的路径}}"`
|
||||
`cmstp /s "{{path\to\profile_file}}"`
|
||||
|
||||
- 卸载一个指定的配置文件:
|
||||
- 卸载特定配置文件:
|
||||
|
||||
`cmstp /u "{{配置文件的路径}}"`
|
||||
`cmstp /u "{{path\to\profile_file}}"`
|
||||
|
||||
- 静默删除:
|
||||
- 静默卸载,不显示确认提示:
|
||||
|
||||
`cmstp /u /s "{{配置文件的路径}}"`
|
||||
`cmstp /u /s "{{path\to\profile_file}}"`
|
@@ -1,9 +1,9 @@
|
||||
# color
|
||||
# 颜色
|
||||
|
||||
> 设置控制台的前景色和背景色。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/color>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/color>。
|
||||
|
||||
- 将控制台颜色恢复至默认值:
|
||||
- 将控制台颜色设置为默认值:
|
||||
|
||||
`color`
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
|
||||
`color /?`
|
||||
|
||||
- 将控制台前景色和背景色设置为指定颜色:
|
||||
- 使用十六进制数字(`1-9,a-f`)将控制台的前景色和背景色设置为特定颜色:
|
||||
|
||||
`color {{前景色值}}{{背景色值}}`
|
||||
`color {{foreground_code}}{{background_code}}`
|
@@ -1,8 +1,8 @@
|
||||
# comp
|
||||
|
||||
> 比较两个文件或文件集的内容。
|
||||
> 使用通配符(*)来比较文件集。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/comp>.
|
||||
> 使用通配符 (*) 比较文件集。
|
||||
> 更多信息: <https://learn.microsoft.com/windows-server/administration/windows-commands/comp>。
|
||||
|
||||
- 交互式比较文件:
|
||||
|
||||
@@ -10,28 +10,28 @@
|
||||
|
||||
- 比较两个指定的文件:
|
||||
|
||||
`comp {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`comp {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 比较两个文件集:
|
||||
|
||||
`comp {{路径\到\目录1}}\* {{路径\到\目录2}}\*`
|
||||
`comp {{path\to\directory1}}\* {{path\to\directory2}}\*`
|
||||
|
||||
- 以十进制格式显示差异:
|
||||
- 以 [d]ecimal 格式显示差异:
|
||||
|
||||
`comp /d {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`comp /d {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 以 ASCII 字符显示差异:
|
||||
- 以 [a]SCII 格式显示差异:
|
||||
|
||||
`comp /a {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`comp /a {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 显示不同的行数:
|
||||
- 显示差异的 [l]ine 号:
|
||||
|
||||
`comp /l {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`comp /l {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 比较文件时不区分大小写:
|
||||
- 不区分大小写地比较文件:
|
||||
|
||||
`comp /c {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`comp /c {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 只比较每个文件前 5 行的内容:
|
||||
- 仅比较每个文件的前 5 行:
|
||||
|
||||
`comp /n=5 {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`comp /n=5 {{path\to\file1}} {{path\to\file2}}`
|
@@ -1,7 +1,7 @@
|
||||
# cpush
|
||||
|
||||
> 这是 `choco push` 命令的一个别名。
|
||||
> 此命令是 `choco push` 的别名。
|
||||
|
||||
- 原命令的文档在:
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr choco push`
|
||||
`tldr choco push`
|
@@ -1,7 +1,7 @@
|
||||
# cuninst
|
||||
|
||||
> 这是 `choco uninstall` 命令的一个别名。
|
||||
> 此命令是 `choco uninstall` 的别名。
|
||||
|
||||
- 原命令的文档在:
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr choco uninstall`
|
||||
`tldr choco uninstall`
|
16
pages.zh/windows/curl.md
Normal file
16
pages.zh/windows/curl.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# curl
|
||||
|
||||
> 在 PowerShell 中,当原始的 `curl` 程序 (<https://curl.se>) 未正确安装时,此命令可能是 `Invoke-WebRequest` 的别名。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest>。
|
||||
|
||||
- 查看原始 `curl` 命令的文档:
|
||||
|
||||
`tldr curl -p common`
|
||||
|
||||
- 查看 PowerShell 的 `Invoke-WebRequest` 命令的文档:
|
||||
|
||||
`tldr invoke-webrequest`
|
||||
|
||||
- 通过打印其版本号来检查 `curl` 是否已正确安装。如果此命令返回错误,PowerShell 可能已用 `Invoke-WebRequest` 替换此命令:
|
||||
|
||||
`curl --version`
|
16
pages.zh/windows/date.md
Normal file
16
pages.zh/windows/date.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# 日期
|
||||
|
||||
> 显示或设置系统日期。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/date>。
|
||||
|
||||
- 显示当前系统日期并提示输入新日期(留空以保持不变):
|
||||
|
||||
`date`
|
||||
|
||||
- 显示当前系统日期而不提示输入新日期:
|
||||
|
||||
`date /t`
|
||||
|
||||
- 将当前系统日期更改为特定日期:
|
||||
|
||||
`date {{month}}-{{day}}-{{year}}`
|
@@ -1,37 +1,37 @@
|
||||
# del
|
||||
|
||||
> 删除一个或多个文件。
|
||||
> 在 PowerShell 中,此命令为 `Remove-Item` 的別名。本页的描述是基于命令提示符 (`cmd`) 中的 `del`。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/del>.
|
||||
> 在 PowerShell 中,此命令是 `Remove-Item` 的别名。本文件基于命令提示符(`cmd`)版本的 `del`。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/del>。
|
||||
|
||||
- 查阅 PowerShell 的对应命令:
|
||||
- 查看等效 PowerShell 命令的文档:
|
||||
|
||||
`tldr remove-item`
|
||||
|
||||
- 删除一个或多个文件 (可使用通配符):
|
||||
- 删除一个或多个文件或模式:
|
||||
|
||||
`del {{文件1 文件2 ...}}`
|
||||
`del {{file_pattern1 file_pattern2 ...}}`
|
||||
|
||||
- 在删除每个文件之前提示确认:
|
||||
|
||||
`del {{文件}} /p`
|
||||
`del {{file_pattern}} /p`
|
||||
|
||||
- 强制删除只读文件:
|
||||
|
||||
`del {{文件}} /f`
|
||||
`del {{file_pattern}} /f`
|
||||
|
||||
- 递归删除所有子目录中的文件:
|
||||
|
||||
`del {{文件}} /s`
|
||||
`del {{file_pattern}} /s`
|
||||
|
||||
- 在基于全局通配符删除文件时不提示确认:
|
||||
- 基于全局通配符删除文件时不提示:
|
||||
|
||||
`del {{文件}} /q`
|
||||
`del {{file_pattern}} /q`
|
||||
|
||||
- 显示帮助和所有的属性列表:
|
||||
- 显示帮助并列出可用属性:
|
||||
|
||||
`del /?`
|
||||
|
||||
- 根据指定的属性删除文件:
|
||||
- 根据指定属性删除文件:
|
||||
|
||||
`del {{文件}} /a {{属性}}`
|
||||
`del {{file_pattern}} /a {{attribute}}`
|
@@ -1,7 +1,7 @@
|
||||
# dir
|
||||
|
||||
> 列出目录的内容。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/dir>.
|
||||
> 列出目录内容。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/dir>。
|
||||
|
||||
- 显示当前目录的内容:
|
||||
|
||||
@@ -9,12 +9,16 @@
|
||||
|
||||
- 显示指定目录的内容:
|
||||
|
||||
`dir {{目录的路径}}`
|
||||
`dir {{path\to\directory}}`
|
||||
|
||||
- 显示当前目录的内容,包括隐藏的文件:
|
||||
- 显示当前目录的内容,包括隐藏文件:
|
||||
|
||||
`dir /A`
|
||||
`dir /a`
|
||||
|
||||
- 显示指定目录的内容,包括隐藏的文件:
|
||||
- 显示指定目录的内容,包括隐藏文件:
|
||||
|
||||
`dir {{目录的路径}} /A`
|
||||
`dir {{path\to\directory}} /a`
|
||||
|
||||
- 仅显示目录和文件的列表,不附加其他信息:
|
||||
|
||||
`dir /b`
|
32
pages.zh/windows/diskpart.md
Normal file
32
pages.zh/windows/diskpart.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# diskpart
|
||||
|
||||
> 磁盘、卷和分区管理器。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/diskpart>。
|
||||
|
||||
- 在管理员命令提示符下单独运行 diskpart 以进入其命令行:
|
||||
|
||||
`diskpart`
|
||||
|
||||
- 列出所有磁盘:
|
||||
|
||||
`list disk`
|
||||
|
||||
- 选择一个卷:
|
||||
|
||||
`select volume {{volume}}`
|
||||
|
||||
- 为选定的卷分配驱动器字母:
|
||||
|
||||
`assign letter {{letter}}`
|
||||
|
||||
- 创建一个新分区:
|
||||
|
||||
`create partition primary`
|
||||
|
||||
- 激活选定的卷:
|
||||
|
||||
`active`
|
||||
|
||||
- 退出 diskpart:
|
||||
|
||||
`exit`
|
@@ -1,7 +1,7 @@
|
||||
# doskey
|
||||
|
||||
> 管理宏,Windows 命令和命令行。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/doskey>.
|
||||
> 管理宏、窗口命令和命令行。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/doskey>。
|
||||
|
||||
- 列出可用的宏:
|
||||
|
||||
@@ -9,24 +9,24 @@
|
||||
|
||||
- 创建一个新的宏:
|
||||
|
||||
`doskey {{宏的名称}} = "{{命令}}"`
|
||||
`doskey {{name}} = "{{command}}"`
|
||||
|
||||
- 为指定可执行文件创建新的宏:
|
||||
- 为特定可执行文件创建一个新的宏:
|
||||
|
||||
`doskey /exename={{可执行文件名}} {{宏的名称}} = "{{命令}}"`
|
||||
`doskey /exename={{executable}} {{name}} = "{{command}}"`
|
||||
|
||||
- 删除一个宏:
|
||||
|
||||
`doskey {{宏的名称}} =`
|
||||
`doskey {{name}} =`
|
||||
|
||||
- 列出所有储存在内存中的命令:
|
||||
- 显示存储在内存中的所有命令:
|
||||
|
||||
`doskey /history`
|
||||
|
||||
- 将宏保存到文件以便于移植:
|
||||
|
||||
`doskey /macros > {{保存宏的文件名}}`
|
||||
`doskey /macros > {{path\to\macinit_file}}`
|
||||
|
||||
- 从文件中加载宏:
|
||||
- 从文件加载宏:
|
||||
|
||||
`doskey /macrofile = {{保存宏的文件名}}`
|
||||
`doskey /macrofile = {{path\to\macinit_file}}`
|
@@ -1,32 +1,32 @@
|
||||
# driverquery
|
||||
|
||||
> 显示已安装设备驱动程序的信息。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/driverquery>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/driverquery>。
|
||||
|
||||
- 显示所有已安装设备驱动程序的列表:
|
||||
|
||||
`driverquery`
|
||||
|
||||
- 以指定格式显示驱动程序的列表:
|
||||
- 以指定格式显示驱动程序列表:
|
||||
|
||||
`driverquery /fo {{table|list|csv}}`
|
||||
|
||||
- 显示带有列的驱动程序列表,以表明它们是否已签名:
|
||||
- 显示带有列以指示它们是否已签名的驱动程序列表:
|
||||
|
||||
`driverquery /si`
|
||||
|
||||
- 排除输出列表中的标题:
|
||||
- 在输出列表中排除标题:
|
||||
|
||||
`driverquery /nh`
|
||||
|
||||
- 显示远程计算机的驱动程序列表:
|
||||
|
||||
`driverquery /s {{主机名}} /u {{用户名}} /p {{密码}}`
|
||||
`driverquery /s {{hostname}} /u {{username}} /p {{password}}`
|
||||
|
||||
- 显示详细信息的驱动程序列表:
|
||||
- 显示带有详细信息的驱动程序列表:
|
||||
|
||||
`driverquery /v`
|
||||
|
||||
- 显示详细的使用信息:
|
||||
- 显示帮助:
|
||||
|
||||
`driverquery /?`
|
||||
`driverquery /?`
|
21
pages.zh/windows/enable-pnpdevice.md
Normal file
21
pages.zh/windows/enable-pnpdevice.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# 启用-PnpDevice
|
||||
|
||||
> Enable-PnpDevice cmdlet 用于启用即插即用 (PnP) 设备。您必须使用管理员帐户才能启用设备。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/pnpdevice/enable-pnpdevice>。
|
||||
|
||||
- 启用设备:
|
||||
|
||||
`Enable-PnpDevice -InstanceId '使用 Get-PnpDevice 命令检索的值'`
|
||||
|
||||
- 启用所有禁用的 PnP 设备:
|
||||
|
||||
`Get-PnpDevice | Where-Object {$_.Problem -eq 22} | Enable-PnpDevice`
|
||||
|
||||
- 无需确认启用设备:
|
||||
|
||||
`Enable-PnpDevice -InstanceId '使用 Get-PnpDevice 命令检索的值' -Confirm:$False`
|
||||
|
||||
- 模拟如果 cmdlet 运行时将会发生的情况:
|
||||
|
||||
`Enable-PnpDevice -InstanceId 'USB\VID_5986&;PID_0266&;MI_00\7&;1E5D3568&;0&;0000' -WhatIf:$True`
|
@@ -1,21 +1,21 @@
|
||||
# eventcreate
|
||||
|
||||
> 在事件日志中创建自定义条目。
|
||||
> 事件 ID 可以是 1 到 1000 之间的任意数值。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/eventcreate>.
|
||||
> 事件 ID 可以是 1 到 1000 之间的任意数字。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/eventcreate>。
|
||||
|
||||
- 在日志中创建一个具有给定 id(1-1000)的新事件:
|
||||
- 在日志中创建具有给定 ID(1-1000)的新事件:
|
||||
|
||||
`eventcreate /t {{success|error|warning|information}} /id {{id}} /d "{{消息}}"`
|
||||
`eventcreate /t {{success|error|warning|information}} /id {{id}} /d "{{message}}"`
|
||||
|
||||
- 在特定事件日志中创建事件:
|
||||
|
||||
`eventcreate /l {{日志名}} /t {{类型}} /id {{id}} /d "{{消息}}"`
|
||||
`eventcreate /l {{log_name}} /t {{type}} /id {{id}} /d "{{message}}"`
|
||||
|
||||
- 为新创建的事件指定来源:
|
||||
- 创建具有特定源的事件:
|
||||
|
||||
`eventcreate /so {{来源名}} /t {{类型}} /id {{id}} /d "{{消息}}"`
|
||||
`eventcreate /so {{source_name}} /t {{type}} /id {{id}} /d "{{message}}"`
|
||||
|
||||
- 在远程计算机的事件日志中创建事件:
|
||||
|
||||
`eventcreate /s {{主机名}} /u {{用户名}} /p {{密码}} /t {{类型}} /id {{id}} /d "{{消息}}"`
|
||||
`eventcreate /s {{hostname}} /u {{username}} /p {{password}} /t {{type}} /id {{id}} /d "{{message}} "`
|
@@ -1,16 +1,16 @@
|
||||
# exit
|
||||
# 退出
|
||||
|
||||
> 退出当前的命令行实例或 bat 脚本。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/exit>.
|
||||
> 退出当前的 CMD 实例或当前的批处理文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/exit>。
|
||||
|
||||
- 退出当前的命令行实例:
|
||||
- 退出当前的 CMD 实例:
|
||||
|
||||
`exit`
|
||||
|
||||
- 退出当前的 [b]at 脚本:
|
||||
- 退出当前的 [b]atch 脚本:
|
||||
|
||||
`exit /b`
|
||||
|
||||
- 使用一个指定的退出码退出:
|
||||
- 使用特定的退出代码退出:
|
||||
|
||||
`exit {{退出码}}`
|
||||
`exit {{2}}`
|
@@ -1,24 +1,24 @@
|
||||
# expand
|
||||
# 解压
|
||||
|
||||
> 解压一个或多个 cab 文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/expand>.
|
||||
> 解压 Windows Cabinet 文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/expand>。
|
||||
|
||||
- 将单文件 cab 文件解压到指定目录:
|
||||
- 将单文件 Cabinet 文件解压到指定目录:
|
||||
|
||||
`expand {{cab 文件路径}} {{指定的目录}}`
|
||||
`expand {{path\to\file.cab}} {{path\to\directory}}`
|
||||
|
||||
- 列出 cab 文件中的所有文件:
|
||||
- 显示源 Cabinet 文件中的文件列表:
|
||||
|
||||
`expand {{cab 文件路径}} {{指定的目录}} -d`
|
||||
`expand {{path\to\file.cab}} {{path\to\directory}} -d`
|
||||
|
||||
- 从 cab 文件中解压所有的文件:
|
||||
- 从 Cabinet 文件中解压所有文件:
|
||||
|
||||
`expand {{cab 文件路径}} {{指定的目录}} -f:*`
|
||||
`expand {{path\to\file.cab}} {{path\to\directory}} -f:*`
|
||||
|
||||
- 从 cab 文件中解压一个特定的文件:
|
||||
- 从 Cabinet 文件中解压特定文件:
|
||||
|
||||
`expand {{cab 文件路径}} {{指定的目录}} -f:{{文件名}}`
|
||||
`expand {{path\to\file.cab}} {{path\to\directory}} -f:{{path\to\file}}`
|
||||
|
||||
- 解压缩时忽略目录结构,并将它们添加到单个目录中:
|
||||
- 解压时忽略目录结构,并将文件添加到单一目录:
|
||||
|
||||
`expand {{cab 文件路径}} {{指定的目录}} -i`
|
||||
`expand {{path\to\file.cab}} {{path\to\directory}} -i`
|
@@ -1,16 +1,16 @@
|
||||
# explorer
|
||||
# 资源管理器
|
||||
|
||||
> Windows 文件资源管理器。
|
||||
> 更多信息:<https://ss64.com/nt/explorer.html>.
|
||||
> 更多信息: <https://ss64.com/nt/explorer.html>。
|
||||
|
||||
- 打开 Windows 文件资源管理器:
|
||||
- 打开 Windows 资源管理器:
|
||||
|
||||
`explorer`
|
||||
|
||||
- 在当前目录打开 Windows 文件资源管理器:
|
||||
- 在当前目录中打开 Windows 资源管理器:
|
||||
|
||||
`explorer .`
|
||||
|
||||
- 在指定目录打开 Windows 文件资源管理器:
|
||||
- 在特定目录中打开 Windows 资源管理器:
|
||||
|
||||
`explorer {{path/to/directory}}`
|
||||
`explorer {{path\to\directory}}`
|
@@ -1,33 +1,33 @@
|
||||
# fc
|
||||
|
||||
> 比较两个文件或文件集之间的差异。
|
||||
> 使用通配符(*)来比较文件集。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/fc>.
|
||||
> 使用通配符 (*) 来比较文件集。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/fc>。
|
||||
|
||||
- 比较两个指定的文件:
|
||||
|
||||
`fc {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 比较时不区分大小写:
|
||||
- 执行不区分大小写的比较:
|
||||
|
||||
`fc /c {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc /c {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 将文件作为 Unicode 文本来进行比较:
|
||||
- 将文件作为 Unicode 文本进行比较:
|
||||
|
||||
`fc /u {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc /u {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 将文件作为 ASCII 文本来进行比较:
|
||||
- 将文件作为 ASCII 文本进行比较:
|
||||
|
||||
`fc /l {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc /l {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 将文件作为二进制来比较:
|
||||
- 将文件作为二进制进行比较:
|
||||
|
||||
`fc /b {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc /b {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 禁用制表符到空格的扩展:
|
||||
|
||||
`fc /t {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc /t {{path\to\file1}} {{path\to\file2}}`
|
||||
|
||||
- 压缩空格(制表符和空格)进行比较:
|
||||
- 压缩比较中的空白字符(制表符和空格):
|
||||
|
||||
`fc /w {{文件 1 的路径}} {{文件 2 的路径}}`
|
||||
`fc /w {{path\to\file1}} {{path\to\file2}}`
|
@@ -1,20 +1,20 @@
|
||||
# find
|
||||
# 查找
|
||||
|
||||
> 在一个或多个文件里查找指定字符串。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/find>.
|
||||
> 在文件中查找指定字符串。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/find>。
|
||||
|
||||
- 查找包含指定字符串的行:
|
||||
|
||||
`find "{{字符串}}" {{文件或目录的路径}}`
|
||||
`find "{{string}}" {{path\to\file_or_directory}}`
|
||||
|
||||
- 查找不包含指定字符串的行:
|
||||
- 显示不包含指定字符串的行:
|
||||
|
||||
`find "{{字符串}}" {{文件或目录的路径}} /v`
|
||||
`find "{{string}}" {{path\to\file_or_directory}} /v`
|
||||
|
||||
- 显示包含指定字符串的行的总数:
|
||||
- 显示包含指定字符串的行数:
|
||||
|
||||
`find "{{字符串}}" {{文件或目录的路径}} /c`
|
||||
`find "{{string}}" {{path\to\file_or_directory}} /c`
|
||||
|
||||
- 显示匹配的行的行数:
|
||||
- 显示包含行号的行列表:
|
||||
|
||||
`find "{{字符串}}" {{文件或目录的路径}} /n`
|
||||
`find "{{string}}" {{path\to\file_or_directory}} /n`
|
@@ -1,32 +1,36 @@
|
||||
# findstr
|
||||
|
||||
> 在一个或多个文件中查找指定的文本。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/findstr>.
|
||||
> 在一个或多个文件中查找指定文本。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/findstr>。
|
||||
|
||||
- 在所有文件中查找以空格分隔的字符串:
|
||||
- 在所有文件中查找一个或多个字符串:
|
||||
|
||||
`findstr "{{查询语句 查询语句 ..}}" *`
|
||||
`findstr "{{string1 string2 ...}}" *`
|
||||
|
||||
- 以递归方式在所有文件中查找以空格分隔的字符串:
|
||||
- 在管道命令的输出中查找一个或多个字符串:
|
||||
|
||||
`findstr /s "{{查询语句 查询语句 ..}}" *`
|
||||
`{{dir}} | findstr "{{string1 string2 ...}}"`
|
||||
|
||||
- 查找时不区分大小写:
|
||||
- 在所有文件中递归查找一个或多个字符串:
|
||||
|
||||
`findstr /i "{{查询语句}}" *"`
|
||||
`findstr /s "{{string1 string2 ...}}" *`
|
||||
|
||||
- 使用正则表达式搜索:
|
||||
- 使用不区分大小写的搜索查找字符串:
|
||||
|
||||
`findstr /r "{{正则表达式}}" *`
|
||||
`findstr /i "{{string1 string2 ...}}" *`
|
||||
|
||||
- 在所有文本文件中查找文字字符串(包含空格):
|
||||
- 在所有文件中使用正则表达式查找字符串:
|
||||
|
||||
`findstr /c:"{{查询语句}}" *.txt`
|
||||
`findstr /r "{{expression}}" *`
|
||||
|
||||
- 显示匹配的行的行数:
|
||||
- 在所有文本文件中查找包含空格的字面字符串:
|
||||
|
||||
`findstr /n "{{查询语句}}" *`
|
||||
`findstr /c:"{{string1 string2 ...}}" *.txt`
|
||||
|
||||
- 只显示匹配的文件名:
|
||||
- 在每个匹配行之前显示行号:
|
||||
|
||||
`findstr /m "{{查询语句}}" *`
|
||||
`findstr /n "{{string1 string2 ...}}" *`
|
||||
|
||||
- 仅显示包含匹配项的文件名:
|
||||
|
||||
`findstr /m "{{string1 string2 ...}}" *`
|
@@ -1,21 +1,21 @@
|
||||
# finger
|
||||
|
||||
> 返回有关指定系统上的一个或多个用户的信息。
|
||||
> 返回指定系统上用户的信息。
|
||||
> 远程系统必须运行 Finger 服务。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/finger>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/finger>。
|
||||
|
||||
- 显示有关特定用户的信息:
|
||||
- 显示特定用户的信息:
|
||||
|
||||
`finger {{用户名}}@{{主机名}}`
|
||||
`finger {{user}}@{{host}}`
|
||||
|
||||
- 在指定的主机上显示所有用户的信息:
|
||||
- 显示指定主机上所有用户的信息:
|
||||
|
||||
`finger @{{主机名}}`
|
||||
`finger @{{host}}`
|
||||
|
||||
- 以更长的格式显示信息:
|
||||
|
||||
`finger {{用户名}}@{{主机名}} -l`
|
||||
`finger {{user}}@{{host}} -l`
|
||||
|
||||
- 显示帮助信息:
|
||||
|
||||
`finger /?`
|
||||
`finger /?`
|
@@ -1,16 +1,16 @@
|
||||
# fondue
|
||||
# 火锅
|
||||
|
||||
> 可选 Windows 功能的命令行安装程序。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/fondue>.
|
||||
> 安装可选的 Windows 功能。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/fondue>。
|
||||
|
||||
- 启用一个指定的 Windows 功能:
|
||||
- 启用特定的 Windows 功能:
|
||||
|
||||
`fondue /enable-feature:{{功能}}`
|
||||
`fondue /enable-feature:{{feature}}`
|
||||
|
||||
- 向用户隐藏所有输出信息:
|
||||
- 将所有输出消息隐藏给用户:
|
||||
|
||||
`fondue /enable-feature:{{功能}} /hide-ux:all`
|
||||
`fondue /enable-feature:{{feature}} /hide-ux:all`
|
||||
|
||||
- 为错误报告指定调用者进程名称:
|
||||
- 指定用于错误报告的调用进程名称:
|
||||
|
||||
`fondue /enable-feature:{{功能}} /caller-name:{{名称}}`
|
||||
`fondue /enable-feature:{{feature}} /caller-name:{{name}}`
|
24
pages.zh/windows/for.md
Normal file
24
pages.zh/windows/for.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# 循环执行
|
||||
|
||||
> 有条件地多次执行命令。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/for>。
|
||||
|
||||
- 对指定的集合执行给定命令:
|
||||
|
||||
`for %{{变量}} in ({{项_a 项_b 项_c}}) do ({{echo 循环已执行}})`
|
||||
|
||||
- 遍历给定范围的数字:
|
||||
|
||||
`for /l %{{变量}} in ({{起始}}, {{步长}}, {{结束}}) do ({{echo 循环已执行}})`
|
||||
|
||||
- 遍历给定的文件列表:
|
||||
|
||||
`for %{{变量}} in ({{路径\to\文件1.ext 路径\to\文件2.ext ...}}) do ({{echo 循环已执行}})`
|
||||
|
||||
- 遍历给定的目录列表:
|
||||
|
||||
`for /d %{{变量}} in ({{路径\to\目录1.ext 路径\to\目录2.ext ...}}) do ({{echo 循环已执行}})`
|
||||
|
||||
- 在每个目录中执行给定命令:
|
||||
|
||||
`for /d %{{变量}} in (*) do (if exist %{{变量}} {{echo 循环已执行}})`
|
@@ -1,28 +1,28 @@
|
||||
# forfiles
|
||||
|
||||
> 选择一个或多个文件以执行指定的命令。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/forfiles>.
|
||||
> 选择要对其执行指定命令的文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/forfiles>。
|
||||
|
||||
- 在当前的目录中寻找文件:
|
||||
- 在当前目录中搜索文件:
|
||||
|
||||
`forfiles`
|
||||
|
||||
- 在一个指定目录中寻找文件:
|
||||
- 在特定目录中搜索文件:
|
||||
|
||||
`forfiles /p {{目录的路径}}`
|
||||
`forfiles /p {{path\to\directory}}`
|
||||
|
||||
- 为每个文件执行指定的命令:
|
||||
- 对每个文件运行指定的命令:
|
||||
|
||||
`forfiles /c "{{命令}}"`
|
||||
`forfiles /c "{{command}}"`
|
||||
|
||||
- 使用通配符来寻找指定的文件:
|
||||
- 使用特定的全局掩码搜索文件:
|
||||
|
||||
`forfiles /m {{通配符}}`
|
||||
`forfiles /m {{glob_pattern}}`
|
||||
|
||||
- 递归寻找文件:
|
||||
- 递归搜索文件:
|
||||
|
||||
`forfiles /s`
|
||||
|
||||
- 搜索超过 5 天的文件:
|
||||
|
||||
`forfiles /d +{{5}}`
|
||||
`forfiles /d +{{5}}`
|
24
pages.zh/windows/fsutil.md
Normal file
24
pages.zh/windows/fsutil.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# fsutil
|
||||
|
||||
> 显示有关文件系统卷的信息。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/fsutil>。
|
||||
|
||||
- 显示卷的列表:
|
||||
|
||||
`fsutil volume list`
|
||||
|
||||
- 显示卷的文件系统信息:
|
||||
|
||||
`fsutil fsInfo volumeInfo {{驱动器字母|卷路径}}`
|
||||
|
||||
- 显示所有卷的文件系统自动修复的当前状态:
|
||||
|
||||
`fsutil repair state`
|
||||
|
||||
- 显示所有卷的脏位状态:
|
||||
|
||||
`fsutil dirty query`
|
||||
|
||||
- 设置卷的脏位状态:
|
||||
|
||||
`fsutil dirty set {{驱动器字母|卷路径}}`
|
@@ -1,23 +1,23 @@
|
||||
# ftp
|
||||
|
||||
> 在本地和远程 FTP 服务器之间交互式传输文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/ftp>.
|
||||
> 交互式地在本地和远程 FTP 服务器之间传输文件。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/ftp>。
|
||||
|
||||
- 交互式连接一个远程的 FTP 服务:
|
||||
- 交互式连接到远程 FTP 服务器:
|
||||
|
||||
`ftp {{主机名}}`
|
||||
`ftp {{host}}`
|
||||
|
||||
- 匿名登录:
|
||||
- 以匿名用户身份登录:
|
||||
|
||||
`ftp -A {{主机名}}`
|
||||
`ftp -A {{host}}`
|
||||
|
||||
- 初始连接时禁用自动登录:
|
||||
- 禁用初始连接时的自动登录:
|
||||
|
||||
`ftp -n {{主机名}}`
|
||||
`ftp -n {{host}}`
|
||||
|
||||
- 运行包含 FTP 命令列表的文件:
|
||||
|
||||
`ftp -s:{{文件的路径}} {{主机名}}`
|
||||
`ftp -s:{{path\to\file}} {{host}}`
|
||||
|
||||
- 下载多个文件(通配符表达式):
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
`mput {{*.zip}}`
|
||||
|
||||
- 在远程服务器上删除多个文件:
|
||||
- 删除远程服务器上的多个文件:
|
||||
|
||||
`mdelete {{*.txt}}`
|
||||
|
||||
- 显示详细的帮助:
|
||||
- 显示帮助信息:
|
||||
|
||||
`ftp --help`
|
||||
`ftp --help`
|
@@ -1,7 +1,7 @@
|
||||
# ftype
|
||||
|
||||
> 显示或修改用于文件扩展名关联的文件类型。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/ftype>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/ftype>。
|
||||
|
||||
- 显示所有文件类型的列表:
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
- 显示特定文件类型的关联程序:
|
||||
|
||||
`ftype {{文件类型}}`
|
||||
`ftype {{file_type}}`
|
||||
|
||||
- 设置特定文件类型的关联程序:
|
||||
|
||||
`ftype {{文件类型}}="{{可执行命令的路径}}"`
|
||||
`ftype {{file_type}}="{{path/to/executable_file}}"`
|
7
pages.zh/windows/gal.md
Normal file
7
pages.zh/windows/gal.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# gal
|
||||
|
||||
> 在 PowerShell 中,此命令是 `Get-Alias` 的别名。
|
||||
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr get-alias`
|
25
pages.zh/windows/gcrane-completion.md
Normal file
25
pages.zh/windows/gcrane-completion.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# gcrane 自动补全
|
||||
|
||||
> 为指定的 shell 生成 gcrane 的自动补全脚本。
|
||||
> 可用的 shell 包括 `bash`、`fish`、`powershell` 和 `zsh`。
|
||||
> 更多信息请查看: <https://github.com/google/go-containerregistry/blob/main/cmd/gcrane/README.md>。
|
||||
|
||||
- 为您的 shell 生成自动补全脚本:
|
||||
|
||||
`gcrane completion {{shell_name}}`
|
||||
|
||||
- 禁用补全描述:
|
||||
|
||||
`gcrane completion {{shell_name}} --no-descriptions`
|
||||
|
||||
- 在当前 shell 会话中加载补全(powershell):
|
||||
|
||||
`gcrane completion powershell | Out-String | Invoke-Expression`
|
||||
|
||||
- 为每个新会话加载补全(powershell):
|
||||
|
||||
`gcrane completion powershell | Out-String | Invoke-Expression`
|
||||
|
||||
- 显示帮助信息:
|
||||
|
||||
`gcrane completion {{shell_name}} {{-h|--help}}`
|
13
pages.zh/windows/get-acl.md
Normal file
13
pages.zh/windows/get-acl.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 获取 ACL
|
||||
|
||||
> 获取资源的安全描述符,例如文件或注册表项。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.security/get-acl>。
|
||||
|
||||
- 显示特定目录的 ACL:
|
||||
|
||||
`Get-Acl {{path\to\directory}}`
|
||||
|
||||
- 获取注册表项的 ACL:
|
||||
|
||||
`Get-Acl -Path {{HKLM:\System\CurrentControlSet\Control}} | Format-List`
|
21
pages.zh/windows/get-alias.md
Normal file
21
pages.zh/windows/get-alias.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# 获取别名
|
||||
|
||||
> 列出并获取当前 PowerShell 会话中的命令别名。
|
||||
> 此命令只能在 PowerShell 中运行。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-alias>。
|
||||
|
||||
- 列出当前会话中的所有别名:
|
||||
|
||||
`Get-Alias`
|
||||
|
||||
- 获取别名命令名称:
|
||||
|
||||
`Get-Alias {{command_alias}}`
|
||||
|
||||
- 列出分配给特定命令的所有别名:
|
||||
|
||||
`Get-Alias -Definition {{command}}`
|
||||
|
||||
- 列出以 `abc` 开头的别名,排除以 `def` 结尾的别名:
|
||||
|
||||
`Get-Alias {{abc}}* -Exclude *{{def}}`
|
25
pages.zh/windows/get-childitem.md
Normal file
25
pages.zh/windows/get-childitem.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# 获取子项
|
||||
|
||||
> 列出目录中的项。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-childitem>。
|
||||
|
||||
- 列出当前目录中的所有非隐藏项:
|
||||
|
||||
`Get-ChildItem`
|
||||
|
||||
- 仅列出当前目录中的目录:
|
||||
|
||||
`Get-ChildItem -Directory`
|
||||
|
||||
- 仅列出当前目录中的文件:
|
||||
|
||||
`Get-ChildItem -File`
|
||||
|
||||
- 列出当前目录中的项,包括隐藏项:
|
||||
|
||||
`Get-ChildItem -Hidden`
|
||||
|
||||
- 列出除当前目录外的其他目录中的项:
|
||||
|
||||
`Get-ChildItem -Path {{path\to\directory}}`
|
29
pages.zh/windows/get-command.md
Normal file
29
pages.zh/windows/get-command.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 获取命令
|
||||
|
||||
> 列出并获取当前 PowerShell 会话中的可用命令。
|
||||
> 此命令只能通过 PowerShell 运行。
|
||||
> 更多信息: <https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-command>。
|
||||
|
||||
- 列出当前计算机上所有可用的 PowerShell 命令(别名、cmdlet、函数):
|
||||
|
||||
`Get-Command`
|
||||
|
||||
- 列出当前会话中所有可用的 PowerShell 命令:
|
||||
|
||||
`Get-Command -ListImported`
|
||||
|
||||
- 仅列出计算机上可用的 PowerShell 别名/cmdlet/函数:
|
||||
|
||||
`Get-Command -Type {{Alias|Cmdlet|Function}}`
|
||||
|
||||
- 仅列出当前会话中 PATH 上可用的程序或命令:
|
||||
|
||||
`Get-Command -Type Application`
|
||||
|
||||
- 按模块名称列出仅 PowerShell 命令,例如 `Microsoft.PowerShell.Utility` 用于与实用程序相关的命令:
|
||||
|
||||
`Get-Command -Module {{module}}`
|
||||
|
||||
- 通过命令名称获取命令信息(例如版本号或模块名称):
|
||||
|
||||
`Get-Command {{command}}`
|
17
pages.zh/windows/get-content.md
Normal file
17
pages.zh/windows/get-content.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 获取内容
|
||||
|
||||
> 获取指定位置项的内容。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content>。
|
||||
|
||||
- 显示文件的内容:
|
||||
|
||||
`Get-Content -Path {{path\to\file}}`
|
||||
|
||||
- 显示文件的前几行:
|
||||
|
||||
`Get-Content -Path {{path\to\file}} -TotalCount {{10}}`
|
||||
|
||||
- 显示文件的内容,并持续读取,直到按下 `Ctrl + C`:
|
||||
|
||||
`Get-Content -Path {{path\to\file}} -Wait`
|
21
pages.zh/windows/get-date.md
Normal file
21
pages.zh/windows/get-date.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# 获取日期
|
||||
|
||||
> 获取当前日期和时间。
|
||||
> 注意:该命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date>。
|
||||
|
||||
- 显示当前日期和时间:
|
||||
|
||||
`Get-Date`
|
||||
|
||||
- 使用 .NET 格式说明符显示当前日期和时间:
|
||||
|
||||
`Get-Date -Format "{{yyyy-MM-dd HH:mm:ss}}"`
|
||||
|
||||
- 以 UTC 和 ISO 8601 格式显示当前日期和时间:
|
||||
|
||||
`(Get-Date).ToUniversalTime()`
|
||||
|
||||
- 转换 Unix 时间戳:
|
||||
|
||||
`Get-Date -UnixTimeSeconds {{1577836800}}`
|
17
pages.zh/windows/get-dedupproperties.md
Normal file
17
pages.zh/windows/get-dedupproperties.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 获取数据去重属性
|
||||
|
||||
> 获取数据去重信息。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/storage/get-dedupproperties>。
|
||||
|
||||
- 获取驱动器的数据去重信息:
|
||||
|
||||
`Get-DedupProperties -DriveLetter 'C'`
|
||||
|
||||
- 使用驱动器标签获取驱动器的数据去重信息:
|
||||
|
||||
`Get-DedupProperties -FileSystemLabel 'Label'`
|
||||
|
||||
- 使用输入对象获取驱动器的数据去重信息:
|
||||
|
||||
`Get-DedupProperties -InputObject $(Get-Volume -DriveLetter 'E')`
|
@@ -1,12 +1,13 @@
|
||||
# Get-FileHash
|
||||
# 获取文件哈希
|
||||
|
||||
> 计算一个文件的 HASH 值。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-filehash>.
|
||||
> 计算文件的哈希值。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-filehash>。
|
||||
|
||||
- 使用 SHA256 算法计算给定文件的哈希值:
|
||||
- 使用 SHA256 算法计算指定文件的哈希值:
|
||||
|
||||
`Get-FileHash {{文件路径}}`
|
||||
`Get-FileHash {{路径\到\文件}}`
|
||||
|
||||
- 使用指定的哈希算法计算给定文件的哈希值:
|
||||
- 使用指定算法计算指定文件的哈希值:
|
||||
|
||||
`Get-FileHash {{文件路径}} -Algorithm {{SHA1|SHA384|SHA256|SHA512|MD5}}`
|
||||
`Get-FileHash {{路径\到\文件}} -Algorithm {{SHA1|SHA384|SHA256|SHA512|MD5}}`
|
37
pages.zh/windows/get-help.md
Normal file
37
pages.zh/windows/get-help.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# 获取帮助
|
||||
|
||||
> 显示 PowerShell 命令(别名、cmdlet 和函数)的帮助信息和文档。
|
||||
> 此命令只能通过 PowerShell 运行。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-help>。
|
||||
|
||||
- 显示特定 PowerShell 命令的一般帮助信息:
|
||||
|
||||
`Get-Help {{command}}`
|
||||
|
||||
- 显示特定 PowerShell 命令的更详细文档:
|
||||
|
||||
`Get-Help {{command}} -Detailed`
|
||||
|
||||
- 显示特定 PowerShell 命令的完整技术文档:
|
||||
|
||||
`Get-Help {{command}} -Full`
|
||||
|
||||
- 仅打印特定 PowerShell 命令的某个参数的文档(使用 `*` 显示所有参数),如果可用:
|
||||
|
||||
`Get-Help {{command}} -Parameter {{parameter}}`
|
||||
|
||||
- 仅打印 cmdlet 的示例,如果可用:
|
||||
|
||||
`Get-Help {{command}} -Examples`
|
||||
|
||||
- 列出所有可用的 cmdlet 帮助页面:
|
||||
|
||||
`Get-Help *`
|
||||
|
||||
- 使用 `Update-Help` 更新当前帮助和文档知识库:
|
||||
|
||||
`Update-Help`
|
||||
|
||||
- 在默认网络浏览器中查看 PowerShell 命令文档的在线版本:
|
||||
|
||||
`Get-Help {{command}} -Online`
|
17
pages.zh/windows/get-history.md
Normal file
17
pages.zh/windows/get-history.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 获取历史记录
|
||||
|
||||
> 显示 PowerShell 命令历史记录。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-history>。
|
||||
|
||||
- 显示带有 ID 的命令历史列表:
|
||||
|
||||
`Get-History`
|
||||
|
||||
- 通过 ID 获取 PowerShell 历史项:
|
||||
|
||||
`Get-History -Id {{id}}`
|
||||
|
||||
- 显示最近的 N 条命令:
|
||||
|
||||
`Get-History -Count {{10}}`
|
9
pages.zh/windows/get-location.md
Normal file
9
pages.zh/windows/get-location.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# 获取位置
|
||||
|
||||
> 打印当前/工作目录的名称。
|
||||
> 此命令只能通过 PowerShell 运行。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-location>。
|
||||
|
||||
- 打印当前目录:
|
||||
|
||||
`Get-Location`
|
13
pages.zh/windows/get-wuapiversion.md
Normal file
13
pages.zh/windows/get-wuapiversion.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 获取-WUApi版本
|
||||
|
||||
> 获取Windows Update Agent版本。属于外部`PSWindowsUpdate`模块。
|
||||
> 此命令只能在PowerShell下运行。
|
||||
> 更多信息:<https://github.com/mgajda83/PSWindowsUpdate>。
|
||||
|
||||
- 获取当前安装的Windows Update Agent版本:
|
||||
|
||||
`Get-WUApiVersion`
|
||||
|
||||
- 通过电子邮件(SMTP)发送当前配置数据:
|
||||
|
||||
`Get-WUApiVersion -SendReport -PSWUSettings @{SmtpServer="{{smtp_server}}"; Port={{smtp_port}} From="{{sender_email}}" To="{{receiver_email}}"}`
|
25
pages.zh/windows/get-wuhistory.md
Normal file
25
pages.zh/windows/get-wuhistory.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# 获取-WUHistory
|
||||
|
||||
> 获取 Windows 更新中已安装更新的历史记录。属于外部 `PSWindowsUpdate` 模块的一部分。
|
||||
> 此命令只能在 PowerShell 下运行。
|
||||
> 更多信息:<https://github.com/mgajda83/PSWindowsUpdate>。
|
||||
|
||||
- 获取更新历史记录列表:
|
||||
|
||||
`Get-WUHistory`
|
||||
|
||||
- 列出最近安装的 10 个更新:
|
||||
|
||||
`Get-WUHistory -Last {{10}}`
|
||||
|
||||
- 列出从特定日期到今天安装的所有更新:
|
||||
|
||||
`Get-WUHistory -MaxDate {{date}}`
|
||||
|
||||
- 列出过去 24 小时内安装的所有更新:
|
||||
|
||||
`Get-WUHistory -MaxDate (Get-Date).AddDays(-1)`
|
||||
|
||||
- 通过电子邮件发送结果 (SMTP):
|
||||
|
||||
`Get-WUHistory -SendReport -PSWUSettings @{SmtpServer="{{smtp_server}}"; Port={{smtp_port}} From="{{sender_email}}" To="{{receiver_email}}"}`
|
13
pages.zh/windows/get-wusettings.md
Normal file
13
pages.zh/windows/get-wusettings.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 获取-WU设置
|
||||
|
||||
> 获取当前的Windows更新代理配置。属于外部`PSWindowsUpdate`模块。
|
||||
> 此命令只能在PowerShell中运行。
|
||||
> 更多信息:<https://github.com/mgajda83/PSWindowsUpdate>。
|
||||
|
||||
- 获取当前的Windows更新代理配置:
|
||||
|
||||
`Get-WUSettings`
|
||||
|
||||
- 通过电子邮件(SMTP)发送当前配置数据:
|
||||
|
||||
`Get-WUSettings -SendReport -PSWUSettings @{SmtpServer="{{smtp_server}}"; Port={{smtp_port}} From="{{sender_email}}" To="{{receiver_email}}"}`
|
@@ -1,9 +1,9 @@
|
||||
# getmac
|
||||
|
||||
> 显示系统的 MAC 地址。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/getmac>.
|
||||
> 显示系统的MAC地址。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/getmac>。
|
||||
|
||||
- 显示当前系统的 MAC 地址:
|
||||
- 显示当前系统的MAC地址:
|
||||
|
||||
`getmac`
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
|
||||
`getmac /fo {{table|list|csv}}`
|
||||
|
||||
- 排除输出列表中的标题:
|
||||
- 在输出列表中排除标题:
|
||||
|
||||
`getmac /nh`
|
||||
|
||||
- 显示一个远程主机的 MAC 地址:
|
||||
- 显示远程计算机的MAC地址:
|
||||
|
||||
`getmac /s {{主机名}} /u {{用户名}} /p {{密码}}`
|
||||
`getmac /s {{hostname}} /u {{username}} /p {{password}}`
|
||||
|
||||
- 详细显示 MAC 地址信息:
|
||||
- 显示带有详细信息的MAC地址:
|
||||
|
||||
`getmac /v`
|
||||
|
||||
- 显示详细的帮助信息:
|
||||
- 显示帮助信息:
|
||||
|
||||
`getmac /?`
|
||||
`getmac /?`
|
7
pages.zh/windows/gl.md
Normal file
7
pages.zh/windows/gl.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# gl
|
||||
|
||||
> 在 PowerShell 中,此命令是 `Get-Location` 的别名。
|
||||
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr get-location`
|
20
pages.zh/windows/gpupdate.md
Normal file
20
pages.zh/windows/gpupdate.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# gpupdate
|
||||
|
||||
> 检查并应用 Windows 组策略设置。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/gpupdate>。
|
||||
|
||||
- 检查并应用更新的组策略设置:
|
||||
|
||||
`gpupdate`
|
||||
|
||||
- 指定要检查更新的目标组策略设置:
|
||||
|
||||
`gpupdate /target:{{computer|user}}`
|
||||
|
||||
- 强制重新应用所有组策略设置:
|
||||
|
||||
`gpupdate /force`
|
||||
|
||||
- 显示帮助信息:
|
||||
|
||||
`gpupdate /?`
|
32
pages.zh/windows/if.md
Normal file
32
pages.zh/windows/if.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 如果
|
||||
|
||||
> 在批处理脚本中执行条件处理。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/if>。
|
||||
|
||||
- 如果条件为真,则执行指定的命令:
|
||||
|
||||
`if {{condition}} ({{echo 条件为真}})`
|
||||
|
||||
- 如果条件为假,则执行指定的命令:
|
||||
|
||||
`if not {{condition}} ({{echo 条件为真}})`
|
||||
|
||||
- 如果条件为真则执行第一个指定的命令,否则执行第二个指定的命令:
|
||||
|
||||
`if {{condition}} ({{echo 条件为真}}) else ({{echo 条件为假}})`
|
||||
|
||||
- 检查 `%errorlevel%` 是否大于或等于指定的退出代码:
|
||||
|
||||
`if errorlevel {{2}} ({{echo 条件为真}})`
|
||||
|
||||
- 检查两个字符串是否相等:
|
||||
|
||||
`if %{{variable}}% == {{string}} ({{echo 条件为真}})`
|
||||
|
||||
- 检查两个字符串是否相等且不区分大小写:
|
||||
|
||||
`if /i %{{variable}}% == {{string}} ({{echo 条件为真}})`
|
||||
|
||||
- 检查文件是否存在:
|
||||
|
||||
`if exist {{path\to\file}} ({{echo 条件为真}})`
|
36
pages.zh/windows/install-module.md
Normal file
36
pages.zh/windows/install-module.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# 安装模块
|
||||
|
||||
> 从 PowerShell Gallery、NuGet 和其他存储库安装 PowerShell 模块。
|
||||
> 更多信息请访问:<https://learn.microsoft.com/powershell/module/powershellget/install-module>。
|
||||
|
||||
- 安装模块或将其更新到最新可用版本:
|
||||
|
||||
`Install-Module {{module}}`
|
||||
|
||||
- 安装特定版本的模块:
|
||||
|
||||
`Install-Module {{module}} -RequiredVersion {{version}}`
|
||||
|
||||
- 安装不早于特定版本的模块:
|
||||
|
||||
`Install-Module {{module}} -MinimumVersion {{version}}`
|
||||
|
||||
- 指定所需模块的支持版本范围(包含):
|
||||
|
||||
`Install-Module {{module}} -MinimumVersion {{minimum_version}} -MaximumVersion {{maximum_version}}`
|
||||
|
||||
- 从特定存储库安装模块:
|
||||
|
||||
`Install-Module {{module}} -Repository {{repository}}`
|
||||
|
||||
- 从特定存储库安装模块:
|
||||
|
||||
`Install-Module {{module}} -Repository {{repository1 , repository2 , ...}}`
|
||||
|
||||
- 为所有用户/当前用户安装模块:
|
||||
|
||||
`Install-Module {{module}} -Scope {{AllUsers|CurrentUser}}`
|
||||
|
||||
- 执行干运行以确定通过 `Install-Module` 将安装、升级或移除哪些模块:
|
||||
|
||||
`Install-Module {{module}} -WhatIf`
|
29
pages.zh/windows/invoke-item.md
Normal file
29
pages.zh/windows/invoke-item.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Invoke-Item
|
||||
|
||||
> 在相应的默认程序中打开文件。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.management/invoke-item>。
|
||||
|
||||
- 在其默认程序中打开文件:
|
||||
|
||||
`Invoke-Item -Path {{path\to\file}}`
|
||||
|
||||
- 打开目录中的所有文件:
|
||||
|
||||
`Invoke-Item -Path {{path\to\directory}}\*`
|
||||
|
||||
- 打开目录中的所有 PNG 文件:
|
||||
|
||||
`Invoke-Item -Path {{path\to\directory}}\*.png`
|
||||
|
||||
- 打开包含特定关键字的目录中的所有文件:
|
||||
|
||||
`Invoke-Item -Path {{path\to\directory}}\* -Include {{*keyword*}}`
|
||||
|
||||
- 打开目录中的所有文件,排除包含特定关键字的文件:
|
||||
|
||||
`Invoke-Item -Path {{path\to\directory}}\* -Exclude {{*keyword*}}`
|
||||
|
||||
- 执行干运行以确定通过 `Invoke-Item` 将打开的目录中的文件:
|
||||
|
||||
`Invoke-Item -Path {{path\to\directory}}\* -WhatIf`
|
25
pages.zh/windows/invoke-webrequest.md
Normal file
25
pages.zh/windows/invoke-webrequest.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Invoke-WebRequest
|
||||
|
||||
> 执行对Web的HTTP/HTTPS请求。
|
||||
> 注意:此命令只能通过PowerShell使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest>。
|
||||
|
||||
- 将URL的内容下载到文件中:
|
||||
|
||||
`Invoke-WebRequest {{http://example.com}} -OutFile {{path\to\file}}`
|
||||
|
||||
- 发送表单编码的数据(类型为`application/x-www-form-urlencoded`的POST请求):
|
||||
|
||||
`Invoke-WebRequest -Method Post -Body @{ name='bob' } {{http://example.com/form}}`
|
||||
|
||||
- 使用自定义HTTP方法发送带有额外头部的请求:
|
||||
|
||||
`Invoke-WebRequest -Headers {{@{ X-My-Header = '123' }}} -Method {{PUT}} {{http://example.com}}`
|
||||
|
||||
- 以JSON格式发送数据,指定适当的内容类型头:
|
||||
|
||||
`Invoke-WebRequest -Body {{'{"name":"bob"}'}} -ContentType 'application/json' {{http://example.com/users/1234}}`
|
||||
|
||||
- 传递用户名和密码进行服务器身份验证:
|
||||
|
||||
`Invoke-WebRequest -Headers @{ Authorization = "Basic "+ [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("myusername:mypassword")) } {{http://example.com}}`
|
@@ -1,9 +1,9 @@
|
||||
# ipconfig
|
||||
|
||||
> 显示和管理 Windows 的网络配置。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/ipconfig>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/ipconfig>。
|
||||
|
||||
- 显示网络适配器列表:
|
||||
- 列出所有网络适配器:
|
||||
|
||||
`ipconfig`
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
|
||||
`ipconfig /all`
|
||||
|
||||
- 为一个网络适配器重新获取 IP 地址:
|
||||
- 续租网络适配器的 IP 地址:
|
||||
|
||||
`ipconfig /renew {{适配器}}`
|
||||
`ipconfig /renew {{adapter}}`
|
||||
|
||||
- 为一个网络适配器释放 IP 地址:
|
||||
- 释放网络适配器的 IP 地址:
|
||||
|
||||
`ipconfig /release {{适配器}}`
|
||||
`ipconfig /release {{adapter}}`
|
||||
|
||||
- 显示所有本地 DNS 缓存:
|
||||
- 显示本地 DNS 缓存:
|
||||
|
||||
`ipconfig /displaydns`
|
||||
|
||||
- 清除所有本地 DNS 缓存:
|
||||
- 从本地 DNS 缓存中移除所有数据:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
`ipconfig /flushdns`
|
@@ -1,17 +1,17 @@
|
||||
# iscc
|
||||
|
||||
> Inno Setup 安装程序的编译器。
|
||||
> 它将 Inno Setup 脚本编译为 Windows 安装程序可执行文件。
|
||||
> 更多信息:<https://jrsoftware.org/isinfo.php>.
|
||||
> 它将 Inno Setup 脚本编译成 Windows 安装程序可执行文件。
|
||||
> 更多信息:<https://jrsoftware.org/isinfo.php>。
|
||||
|
||||
- 编译一个 Inno Setup 脚本:
|
||||
- 编译 Inno Setup 脚本:
|
||||
|
||||
`iscc {{脚本路径.iss}}`
|
||||
`iscc {{path\to\file.iss}}`
|
||||
|
||||
- 静默编译一个 Inno Setup 安装程序:
|
||||
- 安静地编译 Inno Setup 安装程序:
|
||||
|
||||
`iscc /Q {{脚本路径.iss}}`
|
||||
`iscc /Q {{path\to\file.iss}}`
|
||||
|
||||
- 编译已签名的 Inno Setup 安装程序:
|
||||
- 编译签名的 Inno Setup 安装程序:
|
||||
|
||||
`iscc /S={{名称}}={{命令}} {{脚本路径.iss}}`
|
||||
`iscc /S={{name}}={{command}} {{path\to\file.iss}}`
|
@@ -1,7 +1,7 @@
|
||||
# iwr
|
||||
|
||||
> 这是 `invoke-webrequest` 命令的一个别名。
|
||||
> 在 PowerShell 中,此命令是 `Invoke-WebRequest` 的别名。
|
||||
|
||||
- 原命令的文档在:
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr invoke-webrequest`
|
||||
`tldr invoke-webrequest`
|
@@ -1,16 +1,16 @@
|
||||
# logoff
|
||||
# 注销
|
||||
|
||||
> 注销登录会话。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/logoff>.
|
||||
> 终止登录会话。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/logoff>。
|
||||
|
||||
- 注销当前会话:
|
||||
- 终止当前会话:
|
||||
|
||||
`logoff`
|
||||
|
||||
- 通过名称和 ID 注销会话:
|
||||
- 通过会话名称或 ID 终止会话:
|
||||
|
||||
`logoff {{会话名|会话 id}}`
|
||||
`logoff {{session_name|session_id}}`
|
||||
|
||||
- 在通过 RDP 连接的特定服务器上注销会话:
|
||||
- 通过 RDP 在特定服务器上终止会话:
|
||||
|
||||
`logoff {{会话名|会话 id}} /server:{{服务器名}}`
|
||||
`logoff {{session_name|session_id}} /server:{{servername}}`
|
13
pages.zh/windows/measure-command.md
Normal file
13
pages.zh/windows/measure-command.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Measure-Command
|
||||
|
||||
> 测量运行脚本块和 cmdlet 所需的时间。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/measure-command>。
|
||||
|
||||
- 测量运行命令所需的时间:
|
||||
|
||||
`Measure-Command { {{command}} }`
|
||||
|
||||
- 将输入传递给 Measure-Command(传递给 `Measure-Command` 的对象在传递给 Expression 参数的脚本块中可用):
|
||||
|
||||
`10, 20, 50 | Measure-Command -Expression { for ($i=0; $i -lt $_; $i++) {$i} }`
|
13
pages.zh/windows/measure-object.md
Normal file
13
pages.zh/windows/measure-object.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Measure-Object
|
||||
|
||||
> 计算对象的数值属性,以及字符串对象中的字符、单词和行,例如文本文件。
|
||||
> 注意:此命令只能通过 PowerShell 使用。
|
||||
> 更多信息:<https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/measure-object>。
|
||||
|
||||
- 计算目录中的文件和文件夹数量:
|
||||
|
||||
`Get-ChildItem | Measure-Object`
|
||||
|
||||
- 将输入通过管道传递给 Measure-Command(通过管道传递给 `Measure-Command` 的对象可以在传递给 Expression 参数的脚本块中使用):
|
||||
|
||||
`"One", "Two", "Three", "Four" | Set-Content -Path "{{path\to\file}}"; Get-Content "{{path\to\file}}"; | Measure-Object -Character -Line -Word`
|
7
pages.zh/windows/mi.md
Normal file
7
pages.zh/windows/mi.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# mi
|
||||
|
||||
> 在 PowerShell 中,此命令是 `Move-Item` 的别名。
|
||||
|
||||
- 查看原始命令的文档:
|
||||
|
||||
`tldr move-item`
|
12
pages.zh/windows/microsoft-edge.md
Normal file
12
pages.zh/windows/microsoft-edge.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# 微软Edge
|
||||
|
||||
> 微软Edge命令行工具在Windows上可用为`msedge`,在其他平台上可用为`microsoft-edge`。
|
||||
> 更多信息:<https://microsoft.com/edge>。
|
||||
|
||||
- 查看Windows版微软Edge的文档:
|
||||
|
||||
`tldr -p windows msedge`
|
||||
|
||||
- 查看其他平台版微软Edge的文档:
|
||||
|
||||
`tldr -p common microsoft-edge`
|
@@ -1,12 +1,12 @@
|
||||
# mkdir
|
||||
|
||||
> 创建一个目录。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/mkdir>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/mkdir>。
|
||||
|
||||
- 创建一个目录:
|
||||
|
||||
`mkdir {{目录名}}`
|
||||
`mkdir {{path\to\directory}}`
|
||||
|
||||
- 递归创建目录及子目录:
|
||||
- 递归创建一个嵌套目录树:
|
||||
|
||||
`mkdir {{子目录名}}`
|
||||
`mkdir {{path\to\sub_directory}}`
|
@@ -1,20 +1,20 @@
|
||||
# mklink
|
||||
|
||||
> 创建符号链接。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/mklink>.
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/mklink>。
|
||||
|
||||
- 创建指向文件的符号链接:
|
||||
|
||||
`mklink {{链接文件的路径}} {{源文件路径}}`
|
||||
`mklink {{路径\到\链接文件}} {{路径\到\源文件}}`
|
||||
|
||||
- 创建指向目录的符号链接:
|
||||
|
||||
`mklink /d {{链接文件的路径}} {{源目录路径}}`
|
||||
`mklink /d {{路径\到\链接文件}} {{路径\到\源目录}}`
|
||||
|
||||
- 创建指向文件的硬链接:
|
||||
|
||||
`mklink /h {{链接文件的路径}} {{源目录路径}}`
|
||||
`mklink /h {{路径\到\链接文件}} {{路径\到\源文件}}`
|
||||
|
||||
- 创建目录链接:
|
||||
- 创建目录连接:
|
||||
|
||||
`mklink /j {{链接文件的路径}} {{源目录路径}}`
|
||||
`mklink /j {{路径\到\链接文件}} {{路径\到\源文件}}`
|
@@ -1,32 +1,32 @@
|
||||
# more
|
||||
|
||||
> 分页显示标准输入或文件的输出。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/more>.
|
||||
> 从 `stdin` 或文件中显示分页输出。
|
||||
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/more>。
|
||||
|
||||
- 分页显示标准输入的输出:
|
||||
- 从 `stdin` 显示分页输出:
|
||||
|
||||
`{{echo test}} | more`
|
||||
|
||||
- 分页显示一个或多个文件的内容:
|
||||
- 从一个或多个文件中显示分页输出:
|
||||
|
||||
`more {{文件的路径}}`
|
||||
`more {{path\to\file}}`
|
||||
|
||||
- 将制表符转换为指定的空格数:
|
||||
- 将制表符转换为指定数量的空格:
|
||||
|
||||
`more {{文件的路径}} /t{{空格数}}`
|
||||
`more {{path\to\file}} /t{{spaces}}`
|
||||
|
||||
- 显示内容前先清屏:
|
||||
- 在显示页面之前清除屏幕:
|
||||
|
||||
`more {{文件的路径}} /c`
|
||||
`more {{path\to\file}} /c`
|
||||
|
||||
- 从第 5 行开始显示输出:
|
||||
- 从第5行开始显示输出:
|
||||
|
||||
`more {{文件的路径}} +{{5}}`
|
||||
`more {{path\to\file}} +{{5}}`
|
||||
|
||||
- 启用扩展交互模式(请参阅使用帮助):
|
||||
- 启用扩展交互模式(有关用法,请参见帮助):
|
||||
|
||||
`more {{文件的路径}} /e`
|
||||
`more {{path\to\file}} /e`
|
||||
|
||||
- 显示全部帮助信息:
|
||||
- 显示帮助:
|
||||
|
||||
`more /?`
|
||||
`more /?`
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user