man *server*

This topic contains 5 replies, has 3 voices, and was last updated by  Shane Lindberg 2 years, 2 months ago.

  • Author
    Posts
  • #28883

    Shane Lindberg
    Participant

    I would expect the following to give me all man pages with the word "server" in them, but I am getting output that does not seem relevent

    PS C:\windows\system32> man *server*
    
    Name                              Category  Module                    Synopsis
    ----                              --------  ------                    --------
    Get-Module                        Cmdlet    Microsoft.PowerShell.Core Gets the modules that have been imported or th...
    Import-Module                     Cmdlet    Microsoft.PowerShell.Core Adds modules to the current session.
    Get-Help                          Cmdlet    Microsoft.PowerShell.Core Displays information about Windows PowerShell ...
    Update-Help                       Cmdlet    Microsoft.PowerShell.Core Downloads and installs the newest help files o...
    Save-Help                         Cmdlet    Microsoft.PowerShell.Core Downloads and saves the newest help files to a...
    Register-PSSessionConfiguration   Cmdlet    Microsoft.PowerShell.Core Creates and registers a new session configurat...
    Unregister-PSSessionConfiguration Cmdlet    Microsoft.PowerShell.Core Deletes registered session configurations from...
    Get-PSSessionConfiguration        Cmdlet    Microsoft.PowerShell.Core Gets the registered session configurations on ...
    Enable-PSSessionConfiguration     Cmdlet    Microsoft.PowerShell.Core Enables the session configurations on the loca...
    Disable-PSSessionConfiguration    Cmdlet    Microsoft.PowerShell.Core Disables session configurations on the local c...
    Enable-PSRemoting                 Cmdlet    Microsoft.PowerShell.Core Configures the computer to receive remote comm...
    Disable-PSRemoting                Cmdlet    Microsoft.PowerShell.Core Prevents remote users from running commands on...
    Invoke-Command                    Cmdlet    Microsoft.PowerShell.Core Runs commands on local and remote computers.
    New-PSSession                     Cmdlet    Microsoft.PowerShell.Core Creates a persistent connection to a local or ...
    Disconnect-PSSession              Cmdlet    Microsoft.PowerShell.Core Disconnects from a session.
    Connect-PSSession                 Cmdlet    Microsoft.PowerShell.Core Reconnects to disconnected sessions
    Receive-PSSession                 Cmdlet    Microsoft.PowerShell.Core Gets results of commands in disconnected sessions
    Get-PSSession                     Cmdlet    Microsoft.PowerShell.Core Gets the Windows PowerShell sessions on local ...
    Remove-PSSession                  Cmdlet    Microsoft.PowerShell.Core Closes one or more Windows PowerShell sessions...
    Start-Job                         Cmdlet    Microsoft.PowerShell.Core Starts a Windows PowerShell background job.
    Get-Job                           Cmdlet    Microsoft.PowerShell.Core Gets Windows PowerShell background jobs that a...
    Receive-Job                       Cmdlet    Microsoft.PowerShell.Core Gets the results of the Windows PowerShell bac...
    Stop-Job                          Cmdlet    Microsoft.PowerShell.Core Stops a Windows PowerShell background job.
    Wait-Job                          Cmdlet    Microsoft.PowerShell.Core Suppresses the command prompt until one or all...
    Remove-Job                        Cmdlet    Microsoft.PowerShell.Core Deletes a Windows PowerShell background job.
    Suspend-Job                       Cmdlet    Microsoft.PowerShell.Core Temporarily stops workflow jobs.
    Resume-Job                        Cmdlet    Microsoft.PowerShell.Core Restarts a suspended job
    Enter-PSSession                   Cmdlet    Microsoft.PowerShell.Core Starts an interactive session with a remote co...
    Exit-PSSession                    Cmdlet    Microsoft.PowerShell.Core Ends an interactive session with a remote comp...
    New-PSSessionOption               Cmdlet    Microsoft.PowerShell.Core Creates an object that contains advanced optio...
    New-PSTransportOption             Cmdlet    Microsoft.PowerShell.Core Creates an object that contains advanced optio...
    New-PSSessionConfigurationFile    Cmdlet    Microsoft.PowerShell.Core Creates a file that defines a session configur...
    ForEach-Object                    Cmdlet    Microsoft.PowerShell.Core Performs an operation against each item in a c...
    Add-Computer                      Cmdlet    Microsoft.PowerShell.M... Add the local computer to a domain or workgroup.
    Clear-EventLog                    Cmdlet    Microsoft.PowerShell.M... Deletes all entries from specified event logs ...
    Copy-Item                         Cmdlet    Microsoft.PowerShell.M... Copies an item from one location to another.
    Debug-Process                     Cmdlet    Microsoft.PowerShell.M... Debugs one or more processes running on the lo...
    Get-ControlPanelItem              Cmdlet    Microsoft.PowerShell.M... Gets control panel items.
    Get-EventLog                      Cmdlet    Microsoft.PowerShell.M... Gets the events in an event log, or a list of ...
    Get-HotFix                        Cmdlet    Microsoft.PowerShell.M... Gets the hotfixes that have been applied to th...
    Get-Process                       Cmdlet    Microsoft.PowerShell.M... Gets the processes that are running on the loc...
    Get-PSDrive                       Cmdlet    Microsoft.PowerShell.M... Gets drives in the current session.
    Get-Service                       Cmdlet    Microsoft.PowerShell.M... Gets the services on a local or remote computer.
    Get-WmiObject                     Cmdlet    Microsoft.PowerShell.M... Gets instances of Windows Management Instrumen...
    Invoke-WmiMethod                  Cmdlet    Microsoft.PowerShell.M... Calls Windows Management Instrumentation (WMI)...
    Limit-EventLog                    Cmdlet    Microsoft.PowerShell.M... Sets the event log properties that limit the s...
    -- More  --
    
  • #28884

    Bob McCoy
    Participant

    It's a little unclear what you mean when you say 'give me all man pages with the word "server" in them'. Do you want the helppages for cmdlets with "server" as part of the cmdlet name? If that's the case you probably want to start with ...

    Get-Command *server* | 
        where {$_.CommandType -eq "Function" -or $_.CommandType -eq "Cmdlet"}
    
  • #28885

    Shane Lindberg
    Participant

    I apologize, that was unclear. Yes, looking for the names of all functions or cmdlets with the name 'server' in them(I do not think any exist, so I would expect no output). When I do the following with 'format', it returns names with 'format' in it. But when I do it with server, I get tons of what appears irrelevant output.

    PS C:\test> man *format*
    
    Name                              Category  Module                    Synopsis
    ----                              --------  ------                    --------
    Export-FormatData                 Cmdlet    Microsoft.PowerShell.U... Saves formatting data from the current session...
    Format-Custom                     Cmdlet    Microsoft.PowerShell.U... Uses a customized view to format the output.
    Format-List                       Cmdlet    Microsoft.PowerShell.U... Formats the output as a list of properties in ...
    Format-Table                      Cmdlet    Microsoft.PowerShell.U... Formats the output as a table.
    Format-Wide                       Cmdlet    Microsoft.PowerShell.U... Formats objects as a wide table that displays ...
    Get-FormatData                    Cmdlet    Microsoft.PowerShell.U... Gets the formatting data in the current session.
    Update-FormatData                 Cmdlet    Microsoft.PowerShell.U... Updates the formatting data in the current ses...
    about_Format.ps1xml               HelpFile                            The Format.ps1xml files in Windows PowerShell ...
    

    this shows me

  • #28886

    Dave Wyatt
    Moderator

    Get-Help (which "man" is an alias for) searches more than just matching command names. In this case, it's probably just finding the word "server" in the examples for those commands. For example, this is from Get-Module:

    ————————– EXAMPLE 9 ————————–

    PS C:\>$s = New-PSSession -ComputerName Server01

    PS C:\>Get-Module -PSSession $s -ListAvailable

    These commands get the modules that are installed on the Server01 computer.

    The first command uses the New-PSSession cmdlet to create a PSSession on the Server01 computer. The command saves the PSSession in the $s variable.

  • #28889

    Bob McCoy
    Participant

    From the Get-Help help file ...

    Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as "Get-Member", a conceptual topic name, such as "about_Objects", or an alias, such as "ls". Wildcards are permitted in cmdlet and provider names, but you cannot use wildcards to find the names of function help and script help topics.

    The -Name parameter is what you are using since you are specifying "*server*" as a positional parameter. In this case, as Dave pointed out, Get-Help may be (in your opinion), overly helpful since it's providing matches within the text of the help file. But it's not broken, it is doing exactly what it said would do.

  • #28891

    Shane Lindberg
    Participant

    I did think to search the help pages for the word server, but I was not finding it. You were correct in needing to search the examples of the help pages to find the term

    PS C:\windows\system32> ((man Get-PSDrive).tolower() -match 'server')
    PS C:\windows\system32> ((man Get-PSDrive -examples).tolower() -match 'server')
        y          filesystem    \\server01\public
        y          filesystem    \\server01\public
        x:        \\server01\public         microsoft windows network
        providername : \\server01\public
        x:                            \\server01\public
        \\server01\public.
    

You must be logged in to reply to this topic.