即便是有经验的 PowerShell 用户也会经常忽略 PowerShell 强大的帮助系统,它类似 Linux 中的 man page。您所需要做的只是一次性下载帮助文件。要下载帮助文件,您需要在提升权限的 PowerShell 中运行以下代码:
1
PS> Update-Help-UICulture en-us-Force
当帮助文件下载完以后,以下是一个很棒的基础列表,展示 PowerShell 语言的几乎所有细节:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
PS> Get-Help about* | Select Name, Synopsis
Name Synopsis ------------ about_ActivityCommonParameters Describes the parameters that Windows... about_Aliases Describes how to use alternate names ... about_Arithmetic_Operators Describes the operators that perform ... about_Arrays Describes arrays, which are data stru... about_Assignment_Operators Describes how to use operators to ass... about_Automatic_Variables Describes variables that store state ... about_Break Describes a statement you can use to ... about_Checkpoint-Workflow Describes the Checkpoint-Workflow act... about_CimSession Describes a CimSession object and the... about_Classes Describes how you can use classes to ... about_Command_Precedence Describes how Windows PowerShell dete... about_Command_Syntax Describes the syntax diagrams that ar... about_Comment_Based_Help Describes how to write comment-based ... about_CommonParameters Describes the parameters ...
CommandType Name Version Sou rce ------------------------- Alias Attach-DbaDatabase0.9.332 dba Alias Backup-DbaDatabaseCertificate0.9.332 dba Alias Connect-DbaSqlServer0.9.332 dba Alias Copy-SqlAgentCategory0.9.332 dba Alias Copy-SqlAlert0.9.332 dba Alias Copy-SqlAudit0.9.332 dba Alias Copy-SqlAuditSpecification0.9.332 dba Alias Copy-SqlBackupDevice0.9.332 dba Alias Copy-SqlCentralManagementServer0.9.332 dba Alias Copy-SqlCredential0.9.332 dba Alias Copy-SqlCustomError0.9.332 dba Alias Copy-SqlDatabase0.9.332 dba Alias Copy-SqlDatabaseAssembly0.9.332 dba Alias Copy-SqlDatabaseMail0.9.332 dba Alias Copy-SqlDataCollector0.9.332 dba Alias Copy-SqlEndpoint0.9.332 dba Alias Copy-SqlExtendedEvent0.9.332 dba Alias Copy-SqlJob0.9.332 dba Alias Copy-SqlJobServer0.9.332 dba Alias Copy-SqlLinkedServer0.9.332 dba Alias Copy-SqlLogin0.9.332 dba Alias Copy-SqlOperator0.9.332 dba Alias Copy-SqlPolicyManagement0.9.332 dba Alias Copy-SqlProxyAccount0.9.332 dba Alias Copy-SqlResourceGovernor0.9.332 dba Alias Copy-SqlServerAgent0.9.332 dba Alias Copy-SqlServerTrigger0.9.332 dba Alias Copy-SqlSharedSchedule0.9.332 dba Alias Copy-SqlSpConfigure0.9.332 dba Alias Copy-SqlSsisCatalog0.9.332 dba ...
# adjust this to match your own info $first = "Tom" $last = "Sawywer" $company = "freelancer.com" $email = "t.sawyer@freelancer.com"
# QR Code will be saved here $path = "$home\Desktop\locationQR.png"
# install the module from the Gallery (only required once) Install-Module QRCodeGenerator -Scope CurrentUser -Force # create QR code via address (requires internet access and Google API to work) New-QRCodeGeolocation-OutPath$path-Address'Bahnhofstrasse 12, Essen'
# open QR code image with an associated program Invoke-Item-Path$path
当您在上述例子中传入一个地址,它将自动通过 Google 免费的 API 翻译成经纬度。这可能并不总是起作用,并且需要 Internet 连接。如果您知道您的位置的经纬度,您当然也可以通过 -Latitude 和 Longitude 参数传入经纬度。
# adjust this to match your own info $first = "Tom" $last = "Sawywer" $company = "freelancer.com" $email = "t.sawyer@freelancer.com"
# QR Code will be saved here $path = "$home\Desktop\vCard.png"
# install the module from the Gallery (only required once) Install-Module QRCodeGenerator -Scope CurrentUser -Force # create QR code New-QRCodeVCard-FirstName$first-LastName$last-Company$company-Email$email-OutPath$path
# open QR code image with an associated program Invoke-Item-Path$path
# adjust this to match your own WiFi $wifi = "myAccessPoint" $pwd = "topSecret12"
# QR Code will be saved here $path = "$home\Desktop\wifiaccess.png"
# install the module from the gallery (only required once) Install-Module QRCodeGenerator -Scope CurrentUser -Force # create QR code New-QRCodeWifiAccess-SSID$wifi-Password$pwd-OutPath$path
# open QR code image with an associated program Invoke-Item-Path$path
这段代码首先下载并安装 QRCodeGenerator 模块,然后生成一个包含您提供的 WiFi 信息的特殊的 QR 码(您需要先调整内容适合您的 WiFi)。
生成的 PNG 图片可以使用大多数现代的智能设备扫描识别,即可使设备连接到 WiFi。
只需要将 QR 码打印几份,下一次迎接客人的时候,只需要提供打印件给客人,他们就可以方便地连上您的 WiFi。