get-parameter – get a list of PowerShell standard parameter names

Windows_PowerShell_iconThis is a work in progress – I’ll turn it into a function at some stage.

Anyway, it’s a common and a good practice to use Powershell’s standard verbs when naming your functions. You can retrieve these by typing

get-verb

at the command line.

I think it’s good to also use Powershell’s standard parameter names when you’re naming your parameters.

I couldn’t find an easy way of retrieving the list of parameteres but this approximates it:

$PARAMETERS = get-command | where-object {$_.CommandType -eq "Cmdlet" } | select Parameters
$PARAMETER_KEYS = foreach ($P in $PARAMETERS)
{
  foreach ($K in $($P.Parameters | select keys))
  {
    $K.Keys
  }
}
$PARAMETER_KEYS | sort-object -unique

The result, on Powershell 2.0 with sqlps loaded, is:

AbortOnError
AclObject
Action
Activity
Add
AdHocPolicyEvaluationMode
Adjust
After
Alias
AliasesToExport
All
AllMatches
AllowClobber
AllowRedirection
Amended
Any
Append
AppendPath
ApplicationArguments
ApplicationBase
ApplicationName
ArgumentList
Arguments
As
AsBaseObject
AsCustomObject
AsHashTable
AsJob
AsPlainText
AsSecureString
Assembly
AssemblyName
Associations
AsString
Attachments
Audit
Authentication
Author
Authority
AutoSize
Average
BackgroundColor
BaseDirectory
BasePropertiesOnly
Bcc
Before
Begin
BinaryPathName
BindingVariable
Body
BodyAsHtml
Breakpoint
BufferSize
CancelTimeout
CaseSensitive
Category
CategoryActivity
CategoryReason
CategoryResourceFile
CategoryTargetName
CategoryTargetType
Cc
Certificate
CertificateThumbprint
Character
ChildPath
Circular
Class
ClrVersion
Cmdlet
CmdletsToExport
CodeDomProvider
Column
Command
CommandLine
CommandName
CommandType
ComObject
CompanyName
CompilerParameters
Completed
Component
ComputerName
ConfigurationName
ConfigurationTypeName
Confirm
ConnectionTimeout
ConnectionUri
Container
Content
Context
Continuous
Copyright
Count
Counter
Credential
CssUri
Culture
CurrentOperation
Database
Date
Day
Days
Debug
Debugger
DedicatedAdministratorConnection
Definition
Delay
DelegateComputer
Delimiter
DeliveryNotificationOption
DependentServices
DependsOn
Depth
Descending
Description
Destination
Detailed
Dialect
DifferenceObject
DirectRead
DisableCommands
DisableNameChecking
DisableVariables
DisplayError
DisplayHint
DisplayName
DomainName
DotNetFrameworkVersion
Drive
EnableAllPrivileges
Encoding
EncryptConnection
End
EndTime
EntryType
Enumerate
ErrorAction
ErrorId
ErrorLevel
ErrorRecord
ErrorVariable
EventArguments
EventId
EventIdentifier
EventName
Examples
Exception
Exclude
ExcludeDifferent
ExcludeProperty
ExecutionPolicy
Expand
ExpandProperty
Expression
FileFormat
FileList
FileName
FilePath
FileVersionInfo
Filter
FilterHashtable
FilterScript
FilterXml
FilterXPath
First
Force
ForegroundColor
Format
FormatsToProcess
FormatTypeName
Forward
Fragment
From
Full
Function
Functionality
FunctionsToExport
Global
GroupBy
Guid
HashAlgorithm
Head
Header
HideComputerName
HideTableHeaders
HostName
Hour
Hours
Id
IdleTimeout
IgnoreProviderContext
IgnoreWarnings
IgnoreWhiteSpace
Impersonation
Include
IncludeChain
IncludeEqual
IncludeScriptBlock
Independent
Index
InitializationScript
InputFile
InputObject
InstanceId
IsAbsolute
IsValid
ItemType
Job
JobName
Keep
Key
Language
Last
LastStatus
Leaf
Line
List
ListAvailable
ListenerOption
ListLog
ListProvider
ListSet
LiteralName
LiteralPath
LoadUserProfile
Locale
Location
LogName
MaxBinaryLength
MaxCharLength
MaxEvents
Maximum
MaximumReceivedDataSizePerCommand
MaximumReceivedDataSizePerCommandMB
MaximumReceivedObjectSize
MaximumReceivedObjectSizeMB
MaximumRedirection
MaximumSize
MaxSamples
MaxSize
MemberDefinition
MemberType
Message
MessageData
MessageResourceFile
Milliseconds
Minimum
Minute
Minutes
Mode
Module
ModuleInfo
ModuleList
ModuleToProcess
ModuleVersion
Month
Name
Namespace
NestedModules
Newest
NewName
NewPassword
NoClobber
NoCompression
NoElement
NoEncryption
NoMachineProfile
NoNewline
NoNewWindow
NoQualifier
NoRecurse
NoServiceRestart
NotMatch
NoTypeInformation
Noun
Object
Off
Oldest
Online
OnType
OpenTimeout
OperationTimeout
Option
OptionSet
OUPath
OutBuffer
OutputAssembly
OutputModule
OutputSqlErrors
OutputType
OutputXml
OutVariable
OverflowAction
Paging
Parameter
ParameterResourceFile
Parent
ParentId
PassThru
Password
Path
PathType
Pattern
PercentComplete
Policy
Port
PostContent
PowerShellHostName
PowerShellHostVersion
PowerShellVersion
PreContent
Prefix
PrependPath
Priority
PrivateData
Process
ProcessorArchitecture
Prompt
Property
PropertyType
ProviderName
ProxyAccessType
ProxyAuthentication
ProxyCredential
PSDrive
PSHost
PSProvider
PutType
Qualifier
Query
QueryTimeout
Quiet
RawData
ReadCount
RecommendedAction
Recurse
RedirectStandardError
RedirectStandardInput
RedirectStandardOutput
ReferencedAssemblies
ReferenceObject
Registered
Relative
Remove
RemoveFileListener
RemoveListener
Repair
Replace
RequiredAssemblies
RequiredModules
RequiredServices
Resolve
ResourceURI
RestorePoint
RestorePointType
RetentionDays
ReturnResult
ReturnType
Role
RollbackPreference
Root
RunAs32
SampleInterval
Scope
Script
ScriptBlock
ScriptsToProcess
Second
Seconds
SecondsRemaining
SecondValue
SecureKey
SecureString
SecurityDescriptorSddl
SelectorSet
Sender
Separator
Server
ServerInstance
Session
SessionOption
SetSeed
SeverityLevel
Shallow
ShowError
ShowSecurityDescriptorUI
SimpleMatch
Skip
SkipCACheck
SkipCNCheck
SkipRevocationCheck
SmtpServer
Source
SourceId
SourceIdentifier
SPNPort
SqlName
Stack
StackName
Start
StartTime
StartupScript
StartupType
State
Static
Status
Step
Stream
Strict
String
StringData
Subject
SubscriptionId
Sum
Summary
SupportedCommand
SupportEvent
SuppressProviderContextWarning
SyncWindow
Syntax
TargetExpression
TargetObject
TargetObjects
TargetServerName
ThreadApartmentState
ThreadOptions
ThrottleLimit
Timeout
TimestampServer
TimeToLive
Title
To
TotalCount
Trace
TransactedScript
Type
TypeDefinition
TypeName
TypesToProcess
UFormat
UICulture
Unique
UnSecure
Uri
Urn
UseCulture
UseDefaultCredential
UseNewEnvironment
UserName
UseSsl
UseTransaction
UseUTF16
UsingNamespace
Value
ValueOnly
ValueSet
Variable
VariablesToExport
Verb
Verbose
Version
View
Visibility
Wait
WarningAction
WarningVariable
WhatIf
Width
WindowStyle
Word
WorkGroupName
WorkingDirectory
Wrap
Xml
XPath
Year
Advertisements