{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 1909-powershell-get-command" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- A Usage of get-command cmdlet" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![Image from Gyazo](https://i.gyazo.com/9c23d8a166aeaa46a042f3b1f33dcf33.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## jupyter notebook\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "https://nbviewer.jupyter.org/github/sakai-memoru/pwshnote/blob/master/1909-powershell-get-command.ipynb" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get-Help " ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "Get-Help Get-Command -online" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "Get-Help Get-Command | Out-String -Stream | Set -Name ary_str" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "55\n" ] } ], "source": [ "$ary_str.Length" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "NAME\n", " Get-Command\n", " \n", "SYNOPSIS\n", " Gets all commands.\n", " \n", " \n", "SYNTAX\n", " Get-Command [[-Name] ] [[-ArgumentList] ] [-All] [-CommandType {Alias | Function | Filter | \n", " Cmdlet | ExternalScript | Application | Script | Workflow | Configuration | All}] [-FullyQualifiedModule \n", " ] [-ListImported] [-Module ] [-ParameterName ] [-ParameterType \n", " ] [-ShowCommandInfo] [-Syntax] [-TotalCount ] []\n", " \n" ] } ], "source": [ "$ary_str[0..13]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "get-help get-command | set -Name store" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "System.Management.Automation.PSCustomObject\n" ] } ], "source": [ "$store.GetType().Fullname" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "examples : @{example=System.Management.Automation.PSObject[]}\n", "inputTypes : @{inputType=@{type=@{name=System.String}; description=System.Management.Automation.PSObject[]}}\n", "alertSet : @{alert=System.Management.Automation.PSObject[]}\n", "syntax : @{syntaxItem=System.Management.Automation.PSObject[]}\n", "parameters : @{parameter=System.Management.Automation.PSObject[]}\n", "details : @{description=System.Management.Automation.PSObject[]; verb=Get; noun=Command; name=Get-Command}\n", "description : {@{Text=The Get-Command cmdlet gets all commands that are installed on the computer, including \n", " cmdlets, aliases, functions, workflows, filters, scripts, and applications. Get-Command gets the \n", " commands from Windows PowerShell modules and snap-ins and commands that were imported from other \n", " sessions. To get only commands that have been imported into the current session, use the ListImported \n", " parameter.\n", " }, @{Text=Without parameters, a Get-Command command gets all of the cmdlets, functions, workflows and \n", " aliases installed on the computer. A `Get-Command *` command gets all types of commands, including all \n", " of the non-Windows PowerShell files in the Path environment variable ($env:path), which it lists in \n", " the Application command type.\n", " }, @{Text=A Get-Command command that uses the exact name of the command, without wildcard characters, \n", " automatically imports the module that contains the command so that you can use the command \n", " immediately. To enable, disable, and configure automatic importing of modules, use the \n", " $PSModuleAutoLoadingPreference preference variable. For more information, see \n", " about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet \n", " library. Get-Command gets its data directly from the command code, unlike Get-Help, which gets its \n", " information from help topics.\n", " }, @{Text=In Windows PowerShell 2.0, Get-Command gets only commands in current session. It does not \n", " get commands from modules that are installed, but not imported. To limit Get-Command in Windows \n", " PowerShell 3.0 and later versions to commands in the current session, use the ListImported parameter.\n", " }...}\n", "relatedLinks : @{navigationLink=System.Management.Automation.PSObject[]}\n", "returnValues : @{returnValue=System.Management.Automation.PSObject[]}\n", "xmlns:maml : http://schemas.microsoft.com/maml/2004/10\n", "xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10\n", "xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10\n", "xmlns:MSHelp : http://msdn.microsoft.com/mshelp\n", "Name : Get-Command\n", "Category : Cmdlet\n", "Synopsis : Gets all commands.\n", "Component : \n", "Role : \n", "Functionality : \n", "PSSnapIn : Microsoft.PowerShell.Core\n", "ModuleName : Microsoft.PowerShell.Core\n", "\n", "\n", "\n" ] } ], "source": [ "$store | format-list *" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "The Get-Command cmdlet gets all commands that are installed on the computer, including cmdlets, aliases, functions, \n", "workflows, filters, scripts, and applications. Get-Command gets the commands from Windows PowerShell modules and \n", "snap-ins and commands that were imported from other sessions. To get only commands that have been imported into the \n", "current session, use the ListImported parameter.\n", "\n", "\n", "Without parameters, a Get-Command command gets all of the cmdlets, functions, workflows and aliases installed on the \n", "computer. A `Get-Command *` command gets all types of commands, including all of the non-Windows PowerShell files in \n", "the Path environment variable ($env:path), which it lists in the Application command type.\n", "\n", "\n", "A Get-Command command that uses the exact name of the command, without wildcard characters, automatically imports the \n", "module that contains the command so that you can use the command immediately. To enable, disable, and configure \n", "automatic importing of modules, use the $PSModuleAutoLoadingPreference preference variable. For more information, see \n", "about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. \n", "Get-Command gets its data directly from the command code, unlike Get-Help, which gets its information from help topics.\n", "\n", "\n", "In Windows PowerShell 2.0, Get-Command gets only commands in current session. It does not get commands from modules \n", "that are installed, but not imported. To limit Get-Command in Windows PowerShell 3.0 and later versions to commands in \n", "the current session, use the ListImported parameter.\n", "\n", "\n", "Starting in Windows PowerShell 5.0, results of the Get-Command cmdlet display a Version column by default. A new \n", "Version property has been added to the CommandInfo class.\n", "\n", "\n", "\n" ] } ], "source": [ "$store.description[0..10]" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " -All []\n", " Indicates that this cmdlet gets all commands, including commands of the same type that have the same name. By \n", " default, Get-Command gets only the commands that run when you type the command name.\n", " \n", " For more information about the method that Windows PowerShell uses to select the command to run when multiple \n", " commands have the same name, see about_Command_Precedence (http://go.microsoft.com/fwlink/?LinkID=113214) in \n", " the TechNet library. For information about module-qualified command names and running commands that do not run \n", " by default because of a name conflict, see about_Modules (http://go.microsoft.com/fwlink/?LinkID=144311).\n", " \n", " This parameter was introduced in Windows PowerShell 3.0.\n", " \n", " In Windows PowerShell 2.0, Get-Command gets all commands by default.\n", " \n", " Required? false\n", " Position? named\n", " Default value False\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -ArgumentList \n", " Specifies an array of arguments. This cmdlet gets information about a cmdlet or function when it is used with \n", " the specified parameters (\"arguments\"). The alias for ArgumentList is Args .\n", " \n", " To detect dynamic parameters that are available only when certain other parameters are used, set the value of \n", " ArgumentList to the parameters that trigger the dynamic parameters.\n", " \n", " To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the ArgumentList parameter \n", " to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a Windows PowerShell \n", " provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters \n", " for the first path the value of ArgumentList . For information about the provider cmdlets, see about_Providers \n", " (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library.\n", " \n", " Required? false\n", " Position? 1\n", " Default value None\n", " Accept pipeline input? False\n", " Accept wildcard characters? false\n", " \n", " -CommandType \n", " Specifies the types of commands that this cmdlet gets. Enter one or more command types. Use CommandType or \n", " its alias, Type . By default, Get-Command gets all cmdlets, functions, and workflows, and aliases.\n", " \n", " The acceptable values for this parameter are:\n", " \n", " - Alias. Gets the aliases of all Windows PowerShell commands. For more information, see about_Aliases.\n", " \n", " - All. Gets all command types. This parameter value is the equivalent of `Get-Command *`.\n", " \n", " - Application. Gets non-Windows-PowerShell files in paths listed in the Path environment variable ($env:path), \n", " including .txt, .exe, and .dll files. For more information about the Path environment variable, see \n", " about_Environment_Variables. - Cmdlet. Gets all cmdlets.\n", " \n", " - ExternalScript. Gets all .ps1 files in the paths listed in the Path environment variable ($env:path). - \n", " Filter and Function. Gets all Windows PowerShell advanced and simple functions and filters.\n", " \n", " - Script. Gets all script blocks. To get Windows PowerShell scripts (.ps1 files), use the ExternalScript value.\n", " \n", " - Workflow. Gets all workflows. For more information about workflows, see Introducing Windows PowerShell \n", " Workflow.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -FullyQualifiedModule \n", " Specifies modules with names that are specified in the form of ModuleSpecification objects, described by the \n", " Remarks section of Module Specification Constructor \n", " (Hashtable)http://msdn.microsoft.com/library/windows/desktop/jj136290(v=vs.85).aspx on the Microsoft Developer \n", " Network (MSDN). For example, the FullyQualifiedModule parameter accepts a module name that is specified in the \n", " format @{ModuleName = \"modulename\"; ModuleVersion = \"version_number\"} or @{ModuleName = \"modulename\"; \n", " ModuleVersion = \"version_number\"; Guid = \"GUID\"}. ModuleName and ModuleVersion are required, but Guid is \n", " optional.\n", " \n", " You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter. The two \n", " parameters are mutually exclusive.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -ListImported []\n", " Indicates that this cmdlet gets only commands in the current session.\n", " \n", " Starting in Windows PowerShell 3.0, by default, Get-Command gets all installed commands, including, but not \n", " limited to, the commands in the current session. In Windows PowerShell 2.0, it gets only commands in the \n", " current session.\n", " \n", " This parameter was introduced in Windows PowerShell 3.0.\n", " \n", " Required? false\n", " Position? named\n", " Default value False\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -Module \n", " Specifies an array of modules. This cmdlet gets the commands that came from the specified modules or snap-ins. \n", " Enter the names of modules or snap-ins, or enter snap-in or module objects.\n", " \n", " This parameter takes string values, but the value of this parameter can also be a PSModuleInfo or PSSnapinInfo \n", " object, such as the objects that the Get-Module, Get-PSSnapin, and Import-PSSession cmdlets return.\n", " \n", " You can refer to this parameter by its name, Module , or by its alias, PSSnapin . The parameter name that you \n", " choose has no effect on the command output.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -Name \n", " Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a name or name \n", " pattern. Wildcard characters are permitted.\n", " \n", " To get commands that have the same name, use the All parameter. When two commands have the same name, by \n", " default, Get-Command gets the command that runs when you type the command name.\n", " \n", " Required? false\n", " Position? 0\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName, ByValue)\n", " Accept wildcard characters? false\n", " \n", " -Noun \n", " Specifies an array of command nouns. This cmdlet gets commands, which include cmdlets, functions, workflows, \n", " and aliases, that have names that include the specified noun. Enter one or more nouns or noun patterns. \n", " Wildcard characters are permitted.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -ParameterName \n", " Specifies an array of parameter names. This cmdlet gets commands in the session that have the specified \n", " parameters. Enter parameter names or parameter aliases. Wildcard characters are supported.\n", " \n", " The ParameterName and ParameterType parameters search only commands in the current session.\n", " \n", " This parameter was introduced in Windows PowerShell 3.0.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? False\n", " Accept wildcard characters? false\n", " \n", " -ParameterType \n", " Specifies an array of parameter names. This cmdlet gets commands in the session that have parameters of the \n", " specified type. Enter the full name or partial name of a parameter type. Wildcard characters are supported.\n", " \n", " The ParameterName and ParameterType parameters search only commands in the current session.\n", " \n", " This parameter was introduced in Windows PowerShell 3.0.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? False\n", " Accept wildcard characters? false\n", " \n", " -ShowCommandInfo []\n", " Indicates that this cmdlet displays command information.\n", " \n", " For more information about the method that Windows PowerShell uses to select the command to run when multiple \n", " commands have the same name, see about_Command_Precedence. For information about module-qualified command \n", " names and running commands that do not run by default because of a name conflict, see about_Modules.\n", " \n", " This parameter was introduced in Windows PowerShell 3.0.\n", " \n", " In Windows PowerShell 2.0, Get-Command gets all commands by default.\n", " \n", " Required? false\n", " Position? named\n", " Default value False\n", " Accept pipeline input? False\n", " Accept wildcard characters? false\n", " \n", " -Syntax []\n", " Indicates that this cmdlet gets only the following specified data about the command:\n", " \n", " - Aliases. Gets the standard name.\n", " \n", " - Cmdlets. Gets the syntax.\n", " \n", " - Functions and filters. Gets the function definition.\n", " \n", " - Scripts and applications or files. Gets the path and filename.\n", " \n", " Required? false\n", " Position? named\n", " Default value False\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -TotalCount \n", " Specifies the number of commands to get. You can use this parameter to limit the output of a command.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " -Verb \n", " Specifies an array of command verbs. This cmdlet gets commands, which include cmdlets, functions, workflows, \n", " and aliases, that have names that include the specified verb. Enter one or more verbs or verb patterns. \n", " Wildcard characters are permitted.\n", " \n", " Required? false\n", " Position? named\n", " Default value None\n", " Accept pipeline input? True (ByPropertyName)\n", " Accept wildcard characters? false\n", " \n", " \n", " This cmdlet supports the common parameters: Verbose, Debug,\n", " ErrorAction, ErrorVariable, WarningAction, WarningVariable,\n", " OutBuffer, PipelineVariable, and OutVariable. For more information, see \n", " about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). \n", " \n", "\n", "\n", "\n" ] } ], "source": [ "$store.parameters" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Show-Commnad" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [] } ], "source": [ "Show-Command Get-Command" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[![Image from Gyazo](https://i.gyazo.com/ba776c7c8716d512a0bf85bead942576.png)](https://gyazo.com/ba776c7c8716d512a0bf85bead942576)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get-Command" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Clear-Item Copy-Item \n", "Get-Item Invoke-Item \n", "Move-Item New-Item \n", "Remove-Item Rename-Item \n", "Set-Item \n", "\n", "\n" ] } ], "source": [ "Get-Command -Noun Item | select Name | format-wide" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get-Alias " ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "CommandType Name Version Source \n", "Alias gcm -> Get-Command \n", "Alias icm -> Invoke-Command \n", "Alias shcm -> Show-Command \n", "Alias trcm -> Trace-Command \n", "\n", "\n" ] } ], "source": [ "get-alias | Out-String -stream | select-string 'command'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### System.Management.Automation.CmdletInfo" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "System.Management.Automation.CmdletInfo\n" ] } ], "source": [ "(gcm get-item).GetType().Fullname" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "gcm get-item | format-list *\n", "\n", "\n", "HelpUri : https://go.microsoft.com/fwlink/?LinkID=113319\n", "DLL : C:\\WINDOWS\\Microsoft.Net\\assembly\\GAC_MSIL\\Microsoft.PowerShell.Commands.Management\\v4.0_3.0.0.0_\n", " _31bf3856ad364e35\\Microsoft.PowerShell.Commands.Management.dll\n", "Verb : Get\n", "Noun : Item\n", "HelpFile : Microsoft.PowerShell.Commands.Management.dll-Help.xml\n", "PSSnapIn : \n", "Version : 3.1.0.0\n", "ImplementingType : Microsoft.PowerShell.Commands.GetItemCommand\n", "Definition : \n", " Get-Item [-Path] [-Filter ] [-Include ] [-Exclude ] \n", " [-Force] [-Credential ] [-UseTransaction] [-Stream ] []\n", " \n", " Get-Item -LiteralPath [-Filter ] [-Include ] [-Exclude ] \n", " [-Force] [-Credential ] [-UseTransaction] [-Stream ] []\n", " \n", "DefaultParameterSet : Path\n", "OutputType : {System.IO.FileInfo, System.Boolean, System.String, System.IO.FileInfo...}\n", "Options : ReadOnly\n", "Name : Get-Item\n", "CommandType : Cmdlet\n", "Source : Microsoft.PowerShell.Management\n", "Visibility : Public\n", "ModuleName : Microsoft.PowerShell.Management\n", "Module : Microsoft.PowerShell.Management\n", "RemotingCapability : PowerShell\n", "Parameters : {[Path, System.Management.Automation.ParameterMetadata], [LiteralPath, \n", " System.Management.Automation.ParameterMetadata], [Filter, \n", " System.Management.Automation.ParameterMetadata], [Include, \n", " System.Management.Automation.ParameterMetadata]...}\n", "ParameterSets : {[-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] \n", " [-Credential ] [-UseTransaction] [-Stream ] [], \n", " -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] \n", " [-Credential ] [-UseTransaction] [-Stream ] []}\n", "\n", "\n", "\n", "\n", "\n" ] } ], "source": [ "gcm get-item | format-list *\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get-Verb" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "get-verb | set -Name ary_verb\n", "\n", "\n" ] } ], "source": [ "get-verb | set -Name ary_verb\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Verb Group \n", "---- ----- \n", "Add Common\n", "Clear Common\n", "Close Common\n", "Copy Common\n", "Enter Common\n", "Exit Common\n", "Find Common\n", "Format Common\n", "Get Common\n", "Hide Common\n", "Join Common\n", "Lock Common\n", "Move Common\n", "New Common\n", "Open Common\n", "Optimize Common\n", "Pop Common\n", "Push Common\n", "Redo Common\n", "Remove Common\n", "Rename Common\n", "Reset Common\n", "Resize Common\n", "Search Common\n", "Select Common\n", "Set Common\n", "Show Common\n", "Skip Common\n", "Split Common\n", "Step Common\n", "Switch Common\n", "Undo Common\n", "Unlock Common\n", "Watch Common\n", "\n", "\n" ] } ], "source": [ "$ary_verb | where {$_.Group -eq 'Common'}" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Backup Checkpoint \n", "Compare Compress \n", "Convert ConvertFrom \n", "ConvertTo Dismount \n", "Edit Expand \n", "Export Group \n", "Import Initialize \n", "Limit Merge \n", "Mount Out \n", "Publish Restore \n", "Save Sync \n", "Unpublish Update \n", "\n", "\n" ] } ], "source": [ "$ary_verb | where {$_.Group -eq 'Data'} | select Verb | format-wide" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Approve Assert \n", "Complete Confirm \n", "Deny Disable \n", "Enable Install \n", "Invoke Register \n", "Request Restart \n", "Resume Start \n", "Stop Submit \n", "Suspend Uninstall \n", "Unregister Wait \n", "\n", "\n" ] } ], "source": [ "$ary_verb | where {$_.Group -eq 'LifeCycle'} | fw verb" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Debug Measure \n", "Ping Repair \n", "Resolve Test \n", "Trace \n", "\n", "\n" ] } ], "source": [ "$ary_verb | where {$_.Group -eq 'Diagnostic'} | fw verb" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Connect Disconnect \n", "Read Receive \n", "Send Write \n", "\n", "\n" ] } ], "source": [ "$ary_verb | where {$_.Group -eq 'Communications'} | fw verb" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Block Grant \n", "Protect Revoke \n", "Unblock Unprotect \n", "Use \n", "\n", "\n" ] } ], "source": [ "$ary_verb | where {$_.Group -in @('security','other')} | fw verb" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Nouns" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Get-Command | set -Name ary_cmd\n", "Get-Verb | select Verb | foreach {$_.Verb}|set -Name ary_verb\n", "$nouns = @(\n", ">> \"Acl\",\"Alias\",\"Certificate\",\"ChildItem\",\"Clipboard\",\n", ">> \"Clixml\",\"Command\",\"Computer\",\"ComputerInfo\",\"Console\",\n", ">> \"Content\",\"ControlPanelItem\",\"Counter\",\"Credential\",\n", ">> \"Csv\",\"Culture\",\"Custom\",\"Date\",\"Debug\",\"Debugger\",\n", ">> \"DedupProperties\",\"Default\",\"Error\",\"Event\",\"EventLog\",\n", ">> \"ExecutionPolicy\",\"Expression\",\"File\",\"FormatData\",\"GridView\",\n", ">> \"Guid\",\"Help\",\"Hex\",\"History\",\"Host\",\"HotFix\",\"Html\",\"Information\",\n", ">> \"InstalledModule\",\"InstalledScript\",\"IseSnippet\",\"Item\",\n", ">> \"ItemProperty\",\"ItemPropertyValue\",\"Job\",\"JobTrigger\",\"Json\",\n", ">> \"List\",\"LocalizedData\",\"Location\",\"MailMessage\",\"Member\",\n", ">> \"Mock\",\"Module\",\"ModuleManifest\",\"ModuleMember\",\"Null\",\"Object\",\n", ">> \"ObjectEvent\",\"OdbcDriver\",\"OdbcDsn\",\"OdbcPerfCounter\",\"Output\",\n", ">> \"PSBreakpoint\",\"PSCallStack\",\"PSDebug\",\"PSDrive\",\"PSSnapin\",\n", ">> \"Package\",\"PackageProvider\",\"PackageSource\",\"Path\",\"Pester\",\"\n", ">> PesterOption\",\"Process\",\"Progress\",\"Random\",\"RecycleBin\",\n", ">> \"RestMethod\",\"Script\",\"ScriptFileInfo\",\"SecureString\",\n", ">> \"Service\",\"Sleep\",\"String\",\"StringData\",\"Table\",\"TemporaryFile\",\n", ">> \"TimeSpan\",\"TimeZone\",\"Trace\",\"TraceSource\",\"Transaction\",\n", ">> \"Transcript\",\"TroubleshootingPack\",\"Type\",\"TypeData\",\n", ">> \"UICulture\",\"Unique\",\"Variable\",\"Verb\",\"Verbose\",\"Warning\",\n", ">> \"WebRequest\",\"WebServiceProxy\",\"Wide\",\"WinEvent\",\n", ">> \"WinHomeLocation\",\"WindowsEdition\",\"WmiEvent\",\"WmiInstance\",\n", ">> \"WmiMethod\",\"WmiObject\",\"Xml\"\n", ">> )\n", ">> \n", "\n" ] } ], "source": [ "Get-Command | set -Name ary_cmd\n", "Get-Verb | select Verb | foreach {$_.Verb}|set -Name ary_verb\n", "$nouns = @(\n", " \"Acl\",\"Alias\",\"Certificate\",\"ChildItem\",\"Clipboard\",\n", " \"Clixml\",\"Command\",\"Computer\",\"ComputerInfo\",\"Console\",\n", " \"Content\",\"ControlPanelItem\",\"Counter\",\"Credential\",\n", " \"Csv\",\"Culture\",\"Custom\",\"Date\",\"Debug\",\"Debugger\",\n", " \"DedupProperties\",\"Default\",\"Error\",\"Event\",\"EventLog\",\n", " \"ExecutionPolicy\",\"Expression\",\"File\",\"FormatData\",\"GridView\",\n", " \"Guid\",\"Help\",\"Hex\",\"History\",\"Host\",\"HotFix\",\"Html\",\"Information\",\n", " \"InstalledModule\",\"InstalledScript\",\"IseSnippet\",\"Item\",\n", " \"ItemProperty\",\"ItemPropertyValue\",\"Job\",\"JobTrigger\",\"Json\",\n", " \"List\",\"LocalizedData\",\"Location\",\"MailMessage\",\"Member\",\n", " \"Mock\",\"Module\",\"ModuleManifest\",\"ModuleMember\",\"Null\",\"Object\",\n", " \"ObjectEvent\",\"OdbcDriver\",\"OdbcDsn\",\"OdbcPerfCounter\",\"Output\",\n", " \"PSBreakpoint\",\"PSCallStack\",\"PSDebug\",\"PSDrive\",\"PSSnapin\",\n", " \"Package\",\"PackageProvider\",\"PackageSource\",\"Path\",\"Pester\",\"\n", " PesterOption\",\"Process\",\"Progress\",\"Random\",\"RecycleBin\",\n", " \"RestMethod\",\"Script\",\"ScriptFileInfo\",\"SecureString\",\n", " \"Service\",\"Sleep\",\"String\",\"StringData\",\"Table\",\"TemporaryFile\",\n", " \"TimeSpan\",\"TimeZone\",\"Trace\",\"TraceSource\",\"Transaction\",\n", " \"Transcript\",\"TroubleshootingPack\",\"Type\",\"TypeData\",\n", " \"UICulture\",\"Unique\",\"Variable\",\"Verb\",\"Verbose\",\"Warning\",\n", " \"WebRequest\",\"WebServiceProxy\",\"Wide\",\"WinEvent\",\n", " \"WinHomeLocation\",\"WindowsEdition\",\"WmiEvent\",\"WmiInstance\",\n", " \"WmiMethod\",\"WmiObject\",\"Xml\"\n", ")\n" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Get-Command | set -Name ary_cmd\n" ] } ], "source": [ "$ary = @()\n", "$dic = @{}\n", "$arylist = New-Object System.Collections.ArrayList\n", "$arylist.Clear()\n", "\n", "foreach($ar in $ary_cmd)\n", "{\n", " $buf = $ar -split '-' \n", " if($buf[0] -in $ary_verb)\n", " {\n", " $null = $arylist.Add(@($buf[0], $buf[1]))\n", " # $buf[0] + ' : ' + $buf[1]\n", " }\n", "}\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "$i = 0\n", "foreach($a in $arylist)\n" ] } ], "source": [ "$i = 0\n", "foreach($a in $arylist)\n", "{\n", " if($a[1] -in $nouns){\n", " if($a[1] -in $dic.Keys)\n", " {\n", " $dic[$a[1]] += $a[0]\n", " }else{\n", " $dic[$a[1]] = @()\n", " $dic[$a[1]] += $a[0]\n", " }\n", " $i++\n", " # if($i -gt 100){break}\n", " }\n", "}" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ">> {\n", ">> if($a[1] -in $nouns){\n", ">> if($a[1] -in $dic.Keys)\n", ">> {\n", ">> $dic[$a[1]] += $a[0]\n", ">> }else{\n", ">> $dic[$a[1]] = @()\n", ">> $dic[$a[1]] += $a[0]\n", ">> }\n", ">> $i++\n", ">> # if($i -gt 100){break}\n", ">> }\n", ">> }\n", ">> \n", "$dic.GetEnumerator() | \n", ">> Sort-Object { $_.key } | \n", ">> select key, value | set -Name ordered\n", ">> \n" ] } ], "source": [ "$dic.GetEnumerator() | \n", " Sort-Object { $_.key } | \n", " select key, value | set -Name ordered" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Key Value \n", "--- ----- \n", "Acl {Get, Set} \n", "Alias {Export, Get, Import, New...} \n", "Certificate {Export, Get, Import, Switch...} \n", "ChildItem {Get} \n", "Clipboard {Get, Set} \n", "Clixml {Export, Import} \n", "Command {Find, Get, Invoke, Measure...} \n", "Computer {Add, Checkpoint, Remove, Rename...} \n", "ComputerInfo {Get} \n", "Console {Export} \n", "Content {Add, Clear, Get, Set} \n", "ControlPanelItem {Get, Show} \n", "Counter {Export, Get, Import} \n", "Credential {Get} \n", "Csv {ConvertFrom, ConvertTo, Export, Import}\n", "Culture {Get, Set} \n", "Custom {Format} \n", "Date {Get, Set} \n", "Debug {Write} \n", "Debugger {Wait} \n", "DedupProperties {Get} \n", "Default {Out} \n", "Error {Write} \n", "Event {Get, New, Remove, Unregister...} \n", "EventLog {Clear, Get, Limit, New...} \n", "ExecutionPolicy {Get, Set} \n", "Expression {Invoke} \n", "\n", "\n" ] } ], "source": [ "$ordered[0..26]" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Key Value \n", "--- ----- \n", "File {Out, Unblock} \n", "FormatData {Export, Get, Update} \n", "GridView {Out} \n", "Guid {New} \n", "Help {Get, Save, Update} \n", "Hex {Format} \n", "History {Add, Clear, Get, Invoke} \n", "Host {Clear, Get, Out, Read...} \n", "HotFix {Get} \n", "Html {ConvertTo} \n", "Information {Write} \n", "InstalledModule {Get} \n", "InstalledScript {Get} \n", "IseSnippet {Get, Import, New} \n", "Item {Clear, Copy, Get, Invoke...} \n", "ItemProperty {Clear, Copy, Get, Move...} \n", "ItemPropertyValue {Get} \n", "Job {Debug, Get, Receive, Remove...} \n", "JobTrigger {Add, Disable, Enable, Get...} \n", "Json {ConvertFrom, ConvertTo} \n", "List {Format, Update} \n", "LocalizedData {Import} \n", "Location {Get, Pop, Push, Set} \n", "MailMessage {Send} \n", "Member {Add, Get} \n", "Mock {Invoke} \n", "Module {Find, Install, Publish, Save...} \n", "ModuleManifest {Update, New, Test} \n", "ModuleMember {Export} \n", "Null {Out} \n", "Object {Compare, Group, Measure, New...} \n", "ObjectEvent {Register} \n", "OdbcDriver {Get, Set} \n", "OdbcDsn {Add, Get, Remove, Set} \n", "OdbcPerfCounter {Disable, Enable, Get} \n", "Output {Write} \n", "Package {Find, Get, Install, Save...} \n", "PackageProvider {Find, Get, Import, Install} \n", "PackageSource {Get, Register, Set, Unregister} \n", "Path {Convert, Join, Resolve, Split...}\n", "Pester {Invoke} \n", "Process {Debug, Get, Start, Stop...} \n", "Progress {Write} \n", "PSBreakpoint {Disable, Enable, Get, Remove...} \n", "PSCallStack {Get} \n", "PSDebug {Set} \n", "PSDrive {Get, New, Remove} \n", "PSSnapin {Add, Get, Remove} \n", "Random {Get} \n", "RecycleBin {Clear} \n", "RestMethod {Invoke} \n", "\n", "\n" ] } ], "source": [ "$ordered[27..77]" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Key Value \n", "--- ----- \n", "Script {Find, Install, Publish, Save...} \n", "ScriptFileInfo {New, Test, Update} \n", "SecureString {ConvertFrom, ConvertTo} \n", "Service {Get, New, Restart, Resume...} \n", "Sleep {Start} \n", "String {ConvertFrom, Convert, Out, Select}\n", "StringData {ConvertFrom} \n", "Table {Format} \n", "TemporaryFile {New} \n", "TimeSpan {New} \n", "TimeZone {Get, Set} \n", "Trace {Start, Stop, Export} \n", "TraceSource {Get, Set} \n", "Transaction {Complete, Get, Start, Undo...} \n", "Transcript {Start, Stop} \n", "TroubleshootingPack {Get, Invoke} \n", "Type {Add} \n", "TypeData {Get, Remove, Update} \n", "UICulture {Get} \n", "Unique {Get} \n", "Variable {Clear, Get, New, Remove...} \n", "Verb {Get} \n", "Verbose {Write} \n", "Warning {Write} \n", "WebRequest {Invoke} \n", "WebServiceProxy {New} \n", "Wide {Format} \n", "WindowsEdition {Get, Set} \n", "WinEvent {Get, New} \n", "WinHomeLocation {Get, Set} \n", "WmiEvent {Register} \n", "WmiInstance {Set} \n", "WmiMethod {Invoke} \n", "WmiObject {Get, Remove} \n", "Xml {ConvertTo, Select} \n", "\n", "\n" ] } ], "source": [ "$ordered[78..$ordered.Length]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get-Command and modules" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Name ModuleType ExportedCommands \n", "---- ---------- ---------------- \n", "Microsoft.PowerShell.Management Manifest {[Add-Computer, Add-Computer], [Add-Content, Add-Content], [Checkpoint-Co...\n", "Microsoft.PowerShell.Utility Manifest {[Add-Member, Add-Member], [Add-Type, Add-Type], [Clear-Variable, Clear-V...\n", "PSReadline Script {[Get-PSReadlineKeyHandler, Get-PSReadlineKeyHandler], [Get-PSReadlineOpt...\n", "\n", "\n" ] } ], "source": [ "get-module | ft Name, ModuleType, ExportedCommands" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Add-Computer Add-Content \n", "Checkpoint-Computer Clear-Content \n", "Clear-EventLog Clear-Item \n", "Clear-ItemProperty Clear-RecycleBin \n", "Complete-Transaction Convert-Path \n", "Copy-Item Copy-ItemProperty \n", "Debug-Process Disable-ComputerRestore \n", "Enable-ComputerRestore Get-ChildItem \n", "Get-Clipboard Get-ComputerInfo \n", "Get-ComputerRestorePoint Get-Content \n", "Get-ControlPanelItem Get-EventLog \n", "Get-HotFix Get-Item \n", "Get-ItemProperty Get-ItemPropertyValue \n", "Get-Location Get-Process \n", "Get-PSDrive Get-PSProvider \n", "Get-Service Get-TimeZone \n", "Get-Transaction Get-WmiObject \n", "Invoke-Item Invoke-WmiMethod \n", "Join-Path Limit-EventLog \n", "Move-Item Move-ItemProperty \n", "New-EventLog New-Item \n", "New-ItemProperty New-PSDrive \n", "New-Service New-WebServiceProxy \n", "Pop-Location Push-Location \n", "Register-WmiEvent Remove-Computer \n", "Remove-EventLog Remove-Item \n", "Remove-ItemProperty Remove-PSDrive \n", "Remove-WmiObject Rename-Computer \n", "Rename-Item Rename-ItemProperty \n", "Reset-ComputerMachinePassword Resolve-Path \n", "Restart-Computer Restart-Service \n", "Restore-Computer Resume-Service \n", "Set-Clipboard Set-Content \n", "Set-Item Set-ItemProperty \n", "Set-Location Set-Service \n", "Set-TimeZone Set-WmiInstance \n", "Show-ControlPanelItem Show-EventLog \n", "Split-Path Start-Process \n", "Start-Service Start-Transaction \n", "Stop-Computer Stop-Process \n", "Stop-Service Suspend-Service \n", "Test-ComputerSecureChannel Test-Connection \n", "Test-Path Undo-Transaction \n", "Use-Transaction Wait-Process \n", "Write-EventLog \n", "\n", "\n" ] } ], "source": [ "get-command -Module *.powershell.management | fw Name" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "Add-Member Add-Type \n", "Clear-Variable Compare-Object \n", "ConvertFrom-Csv ConvertFrom-Json \n", "ConvertFrom-String ConvertFrom-StringData \n", "Convert-String ConvertTo-Csv \n", "ConvertTo-Html ConvertTo-Json \n", "ConvertTo-Xml Debug-Runspace \n", "Disable-PSBreakpoint Disable-RunspaceDebug \n", "Enable-PSBreakpoint Enable-RunspaceDebug \n", "Export-Alias Export-Clixml \n", "Export-Csv Export-FormatData \n", "Export-PSSession Format-Custom \n", "Format-List Format-Table \n", "Format-Wide Get-Alias \n", "Get-Culture Get-Date \n", "Get-Event Get-EventSubscriber \n", "Get-FormatData Get-Host \n", "Get-Member Get-PSBreakpoint \n", "Get-PSCallStack Get-Random \n", "Get-Runspace Get-RunspaceDebug \n", "Get-TraceSource Get-TypeData \n", "Get-UICulture Get-Unique \n", "Get-Variable Group-Object \n", "Import-Alias Import-Clixml \n", "Import-Csv Import-LocalizedData \n", "Import-PSSession Invoke-Expression \n", "Invoke-RestMethod Invoke-WebRequest \n", "Measure-Command Measure-Object \n", "New-Alias New-Event \n", "New-Object New-TimeSpan \n", "New-Variable Out-File \n", "Out-GridView Out-Printer \n", "Out-String Read-Host \n", "Register-EngineEvent Register-ObjectEvent \n", "Remove-Event Remove-PSBreakpoint \n", "Remove-TypeData Remove-Variable \n", "Select-Object Select-String \n", "Select-Xml Send-MailMessage \n", "Set-Alias Set-Date \n", "Set-PSBreakpoint Set-TraceSource \n", "Set-Variable Show-Command \n", "Sort-Object Start-Sleep \n", "Tee-Object Trace-Command \n", "Unblock-File Unregister-Event \n", "Update-FormatData Update-List \n", "Update-TypeData Wait-Debugger \n", "Wait-Event Write-Debug \n", "Write-Error Write-Host \n", "Write-Information Write-Output \n", "Write-Progress Write-Verbose \n", "Write-Warning \n", "\n", "\n" ] } ], "source": [ "Get-Command -module Microsoft.PowerShell.Utility -CommandTYpe cmdlet | fw Name" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Get-Command -verb out | ft Name, Source\n", "\n", "Name Source \n", "---- ------ \n", "Out-Default Microsoft.PowerShell.Core \n", "Out-File Microsoft.PowerShell.Utility\n", "Out-GridView Microsoft.PowerShell.Utility\n", "Out-Host Microsoft.PowerShell.Core \n", "Out-Null Microsoft.PowerShell.Core \n", "Out-Printer Microsoft.PowerShell.Utility\n", "Out-String Microsoft.PowerShell.Utility\n", "\n", "\n", "\n", "\n" ] } ], "source": [ "Get-Command -verb out | ft Name, Source\n" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Name Source \n", "---- ------ \n", "Write-FileSystemCache Storage \n", "Write-DtcTransactionsTraceSession MsDtc \n", "Write-PrinterNfcTag PrintManagement \n", "Write-VolumeCache Storage \n", "Write-Debug Microsoft.PowerShell.Utility \n", "Write-Error Microsoft.PowerShell.Utility \n", "Write-EventLog Microsoft.PowerShell.Management\n", "Write-Host Microsoft.PowerShell.Utility \n", "Write-Information Microsoft.PowerShell.Utility \n", "Write-Output Microsoft.PowerShell.Utility \n", "Write-Progress Microsoft.PowerShell.Utility \n", "Write-Verbose Microsoft.PowerShell.Utility \n", "Write-Warning Microsoft.PowerShell.Utility \n", "\n", "\n" ] } ], "source": [ "Get-Command -verb write | ft Name, Source" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Appendix" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "NAME\n", " Get-Command\n", " \n", "SYNOPSIS\n", " Gets all commands.\n", " \n", " \n", "SYNTAX\n", " Get-Command [[-Name] ] [[-ArgumentList] ] [-All] [-CommandType {Alias | Function | Filter | \n", " Cmdlet | ExternalScript | Application | Script | Workflow | Configuration | All}] [-FullyQualifiedModule \n", " ] [-ListImported] [-Module ] [-ParameterName ] [-ParameterType \n", " ] [-ShowCommandInfo] [-Syntax] [-TotalCount ] []\n", " \n", " Get-Command [[-ArgumentList] ] [-All] [-FullyQualifiedModule ] [-ListImported] \n", " [-Module ] [-Noun ] [-ParameterName ] [-ParameterType ] \n", " [-ShowCommandInfo] [-Syntax] [-TotalCount ] [-Verb ] []\n", " \n", " \n", "DESCRIPTION\n", " The Get-Command cmdlet gets all commands that are installed on the computer, including cmdlets, aliases, \n", " functions, workflows, filters, scripts, and applications. Get-Command gets the commands from Windows PowerShell \n", " modules and snap-ins and commands that were imported from other sessions. To get only commands that have been \n", " imported into the current session, use the ListImported parameter.\n", " \n", " Without parameters, a Get-Command command gets all of the cmdlets, functions, workflows and aliases installed on \n", " the computer. A `Get-Command *` command gets all types of commands, including all of the non-Windows PowerShell \n", " files in the Path environment variable ($env:path), which it lists in the Application command type.\n", " \n", " A Get-Command command that uses the exact name of the command, without wildcard characters, automatically imports \n", " the module that contains the command so that you can use the command immediately. To enable, disable, and \n", " configure automatic importing of modules, use the $PSModuleAutoLoadingPreference preference variable. For more \n", " information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft \n", " TechNet library. Get-Command gets its data directly from the command code, unlike Get-Help, which gets its \n", " information from help topics.\n", " \n", " In Windows PowerShell 2.0, Get-Command gets only commands in current session. It does not get commands from \n", " modules that are installed, but not imported. To limit Get-Command in Windows PowerShell 3.0 and later versions to \n", " commands in the current session, use the ListImported parameter.\n", " \n", " Starting in Windows PowerShell 5.0, results of the Get-Command cmdlet display a Version column by default. A new \n", " Version property has been added to the CommandInfo class.\n", " \n", "\n", "RELATED LINKS\n", " Online Version: http://go.microsoft.com/fwlink/?LinkId=821482\n", " Get-Help \n", "\n", "REMARKS\n", " To see the examples, type: \"get-help Get-Command -examples\".\n", " For more information, type: \"get-help Get-Command -detailed\".\n", " For technical information, type: \"get-help Get-Command -full\".\n", " For online help, type: \"get-help Get-Command -online\"\n", "\n", "\n" ] } ], "source": [ "Get-Help Get-Command" ] } ], "metadata": { "kernelspec": { "display_name": "PowerShell", "language": "powershell", "name": "powershell" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".ps1", "mimetype": "text/x-sh", "name": "powershell" } }, "nbformat": 4, "nbformat_minor": 2 }