NAME
Use-JobSchedulerAlias
SYNOPSIS
This cmdlet creates alias names for JobScheduler cmdlets.
SYNTAX
Use-JobSchedulerAlias [-Prefix <String>] [-Excludes <String[]>] [-ExcludesPrefix <String>] -NoDuplicates [<Comm
onParameters>]
DESCRIPTION
To create aliases this cmdlet has to be dot sourced, i.e. use
- . Use-JobSchedulerAlias -Prefix JS: works as expected
- Use-JobSchedulerAlias-Prefix JS: has no effect
When using a number of modules from different vendors then naming conflicts might occur
for cmdlets with the same name from different modules.
The JobScheduler CLI makes use of the following policy:
- All cmdlets use a unique qualifier for the module as e.g. Use-JobSchedulerMaster, Get-JobSchedulerInventory etc.
- Users can use this cmdlet to create a short notation for cmdlet alias names. Two flavors are offered:
- use a shorthand notation as e.g. Use-JSMaster instead of Use-JobSchedulerMaster. This notation is recommended as is
suggests fairly unique names. - use a shorthand notation as e.g. Use-Master instead of Use-JobSchedulerMaster. This notation can conflict with cmdle
ts of the PowerShell Core, e.g. for Start-Job, Stop-Job
- use a shorthand notation as e.g. Use-JSMaster instead of Use-JobSchedulerMaster. This notation is recommended as is
- Users can exclude shorthand notation for specific cmdlets by use of an exclusion list.
You can find the resulting aliases by use of the command Get-Command -Module JobScheduler.
PARAMETERS
Prefix
-Prefix <String>
Specifies the prefix that is used for a shorthand notation, e.g.
- the parameter -Prefix "JS" creates an alias Use-JSMaster for Use-JobSchedulerMaster
- the parameter -Prefix without a value assigned creates an alias Use-Master for Use-JobSchedulerMaster
By default aliases are created for both the prefix "JS" and with no prefix being assigned which results in the foll
owing possible notation:
- Use-JobSchedulerMaster
- Use-JSMaster
- Use-Master
Required? false
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?
Excludes
-Excludes <String[]>
Specifies a list of resulting alias names that are excluded from alias creation.
When using e.g. Use-JobSchedulerAlias -Prefix without a prefix being assigned then
- at the time of writing - the following aliases would conflict with cmdlet names from the PowerShell Core
- Get-Job
- Start-Job
- Stop-Job
Default: -Excludes Get-Job,Start-Job,Stop-Job
Required? false
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?
ExcludesPrefix
-ExcludesPrefix <String>
Required? false
Position? 3
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?
NoDuplicates
-NoDuplicates <SwitchParameter>
This parameters specifies that no aliases should be created that conflict with existing cmdlets, functions or alias
es.
Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?
RELATED LINKS
about_jobscheduler
EXAMPLES
-------------------------- EXAMPLE 1 --------------------------
C:\PS>. Use-JobSchedulerAlias -Prefix JS
Creates aliases for all JobScheduler CLI cmdlets that allow to use e.g. Use-JSMaster for Use-JobSchedulerMaster
-------------------------- EXAMPLE 2 --------------------------
C:\PS>. Use-JobSchedulerAlias -Prefix -Exclude Get-Job,Start-Job,Stop-Job -ExcludePrefix JS
Creates aliases for all JobScheduler CLI cmdlets that allow to use e.g. Use-Master for Use-JobSchedulerMaster.
This is specified by the -Prefix parameter without a value being assigned.
For the resulting alias names Get-Job, Start-Job and Stop-Job the alias names
Get-JSJob, Start-JSJob and Stop-JSJob are created by use of the -ExcludePrefix "JS" parameter.