You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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
  • 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.

  • with the parameter -Prefix "JS" used this cmdlet creates an alias Use-JSMaster for Use-JobSchedulerMaster
  • with the parameter -Prefix being omitted this cmdlet creates an alias Use-Master for Use-JobSchedulerMaster

By default aliases are created for both the prefix "JS" and with an empty prefix being assigned which results in th
e following 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 omitting the Use-JobSchedulerAlias -Prefix parameter 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?

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 -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 omitting the -Prefix parameter.

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.

-------------------------- EXAMPLE 3 --------------------------

C:\PS>. Use-JobSchedulerAlias -NoDuplicates -ExcludesPrefix JS

Creates aliases for all JobScheduler CLI cmdlets that allow to use e.g. Use-Master for Use-JobSchedulerMaster.
Should any alias conflice with an existing cmdlet, function or alias then the alias will be created with the
prefix specified by the -ExcludesPrefix parameter.

  • No labels