- PowerShell 教程
- PowerShell - 主頁
- PowerShell - 概述
- PowerShell - 環境設定
- PowerShell - Cmdlet
- PowerShell - 檔案和資料夾
- PowerShell - 日期和計時器
- PowerShell - 檔案 I/O
- PowerShell - 高階 Cmdlet
- PowerShell - 指令碼編寫
- PowerShell - 特殊變數
- PowerShell - 運算子
- PowerShell - 迴圈
- PowerShell - 條件
- PowerShell - 陣列
- PowerShell - 雜湊表
- PowerShell - 正則表示式
- PowerShell - 反引號
- PowerShell - 括號
- PowerShell - 別名
- PowerShell 有用資源
- PowerShell - 快速指南
- PowerShell - 有用資源
- PowerShell - 討論
Powershell - 別名
PowerShell 別名是 cmdlet 或任何命令元素的另一個名稱。
建立別名
使用 New-Alias cmdlet 建立別名。以下示例中,我們為 Get-Help cmdlet 建立了一個別名 help。
New-Alias -Name help -Value Get-Help
現在呼叫別名。
help Get-WmiObject -Detailed
你將看到以下輸出。
NAME
Get-WmiObject
SYNOPSIS
Gets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.
SYNTAX
Get-WmiObject [
...
獲取別名
使用 Get-Alias cmdlet 獲取 powershell 當前會話中存在的所有別名。
Get-Alias
你將看到以下輸出。
CommandType Name Definition ----------- ---- ---------- Alias % ForEach-Object Alias ? Where-Object Alias ac Add-Content Alias asnp Add-PSSnapIn ...
廣告