Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the module for a given cmdlet?

Tags:

How do I determine the module for a given cmdlet for direct calling from a function that overrides the cmdlet?

For example, how am I supposed to find out that Start-Transcript lives in Microsoft.Powershell.Host?

Get-Module Start-Transcript 

doesn't yield anything


Update for answer below.

This is the output:

PS C:\Windows> Get-Command -type cmdlet start-transcript | fl *  HelpUri             : http://go.microsoft.com/fwlink/?LinkID=113408 DLL                 : C:\Windows\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost\1.0.0.0__31bf3856ad364e35\Microsoft                       .PowerShell.ConsoleHost.dll Verb                : Start Noun                : Transcript HelpFile            : Microsoft.PowerShell.ConsoleHost.dll-Help.xml PSSnapIn            : Microsoft.PowerShell.Host ImplementingType    : Microsoft.PowerShell.Commands.StartTranscriptCommand Definition          : Start-Transcript [[-Path] <String>] [-Append] [-Force] [-NoClobber] [-Verbose] [-Debug] [-ErrorAc                       tion <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningV                       ariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm]  DefaultParameterSet : OutputType          : {} Name                : Start-Transcript CommandType         : Cmdlet Visibility          : Public ModuleName          : Microsoft.PowerShell.Host <------------ HERE IT IS Module              : Parameters          : {[Path, System.Management.Automation.ParameterMetadata], [Append, System.Management.Automation.Pa                       rameterMetadata], [Force, System.Management.Automation.ParameterMetadata], [NoClobber, System.Man                       agement.Automation.ParameterMetadata]...} ParameterSets       : {[[-Path] <String>] [-Append] [-Force] [-NoClobber] [-Verbose] [-Debug] [-ErrorAction <ActionPref                       erence>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>                       ] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm]} 
like image 808
user1324792 Avatar asked Jun 01 '12 17:06

user1324792


People also ask

What module is a cmdlet in?

A PowerShell module is a package containing PowerShell cmdlets, providers, functions, workflows, variables and aliases.

How do I find PowerShell modules?

The Get-InstalledModule cmdlet gets PowerShell modules that are installed on a computer using PowerShellGet. To see all modules installed on the system, use the Get-Module -ListAvailable command.

How do I find a module?

Description. The Find-Module cmdlet finds modules in a repository that match the specified criteria. Find-Module returns a PSRepositoryItemInfo object for each module it finds. The objects can be sent down the pipeline to cmdlets such as Install-Module .

How do I get a list of cmdlets in PowerShell?

Use CommandType or its alias, Type. By default, Get-Command gets all cmdlets, functions, and aliases. The acceptable values for this parameter are: Alias : Gets the aliases of all PowerShell commands.


1 Answers

Use

Get-Command Start-Transcript | fl * 

to find information about the command.

like image 170
CB. Avatar answered Oct 06 '22 00:10

CB.