等价于/?用于Powershell中的cmd命令

时间:2018-07-24 12:08:19

标签: powershell cmd

要获取有关Windows命令提示符cmd.exe中的命令的帮助,我可以这样做:

rmdir /?
xcopy /?
etc.

如何在PowerShell中做到这一点?

2 个答案:

答案 0 :(得分:3)

答案是Get-Help

它显示SyntaxAliasesExamples等。

示例: Get-Help rmdir

NAME
    Remove-Item

SYNTAX
    Remove-Item [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force]
    [-Credential <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>]  [<CommonParameters>]

    Remove-Item -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse]
    [-Force] [-Credential <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>]
    [<CommonParameters>]


ALIASES
    ri
    rm
    rmdir
    del
    erase
    rd

有关更多信息,请使用-Full-Detailed参数: Get-Help <command> -Detailed

NAME
    Remove-Item

SYNTAX
    Remove-Item [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recurse]
    [-Credential <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>]  [<CommonParamet

    Remove-Item -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Recu
    [-Force] [-Credential <pscredential>] [-WhatIf] [-Confirm] [-UseTransaction] [-Stream <string[]>]
    [<CommonParameters>]


PARAMETERS
    -Confirm

    -Credential <pscredential>

    -Exclude <string[]>

    -Filter <string>

    -Force

    -Include <string[]>

    -LiteralPath <string[]>

    -Path <string[]>

    -Recurse

    -Stream <string[]>

    -UseTransaction

    -WhatIf

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).


ALIASES
    ri
    rm
    rmdir
    del
    erase
    rd


REMARKS
    Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
        -- To download and install Help files for the module that includes this cmdlet, use Update-Help.
        -- To view the Help topic for this cmdlet online, type: "Get-Help Remove-Item -Online" or
           go to http://go.microsoft.com/fwlink/?LinkID=113373.

xcopyrobocopy之类的命令本身是可执行的,通常没有Powershell-Help-File。

要获取有关它们的信息,可以尝试/?--?

答案 1 :(得分:2)

Get-Help [command]

是在PowerShell中获取命令文档的通用方法。