< Back
Get-JenkinsJobList
Post
NAME Get-JenkinsJobList
SYNOPSIS
Get a list of jobs in a Jenkins master server.
SYNTAX
Get-JenkinsJobList [-Uri] <String> [[-Credential] <PSCredential>] [[-Crumb] <String>] [[-Folder] <String>]
[[-IncludeClass] <String[]>] [[-ExcludeClass] <String[]>] [<CommonParameters>]
DESCRIPTION
Returns the list of jobs registered on a Jenkins Master server in either the root folder or a specified subfolder.
The list of jobs returned can be filtered by setting the IncludeClass or ExcludeClass parameters. By default any
folders will be filtered from this list.
PARAMETERS
-Uri <String>
Contains the Uri to the Jenkins Master server to execute the command on.
Required? true
Position? 2
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Credential <PSCredential>
Contains the credentials to use to authenticate with the Jenkins Master server.
Required? false
Position? 3
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Crumb <String>
Contains a Crumb to pass to the Jenkins Master Server if CSRF is enabled.
Required? false
Position? 4
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Folder <String>
The optional job folder to retrieve the jobs from. This requires the Jobs Plugin to be installed on Jenkins.
Required? false
Position? 5
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-IncludeClass <String[]>
This allows the class of objects that are returned to be limited to only these types.
Required? false
Position? 6
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ExcludeClass <String[]>
This allows the class of objects that are returned to exclude these types.
Required? false
Position? 7
Default value None
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
An array of Jenkins Job objects.
NOTES
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$Jobs = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Verbose
Returns the list of jobs on https://jenkins.contoso.com using the credentials provided by the user.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$Jobs = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Folder 'Misc' \\`
-Verbose
Returns the list of jobs in the 'Misc' folder on https://jenkins.contoso.com using the credentials provided by the
user.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>$Folders = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Folder 'Misc' \\`
-IncludeClass 'hudson.model.FreeStyleProject' \\`
-Verbose
Returns the list of freestyle Jenknins jobs in the 'Misc' folder on https://jenkins.contoso.com using the
credentials provided by the user.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>$Folders = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Folder 'Misc\\Builds' \\`
-Verbose
Returns the list of jobs in the 'Builds' folder within the 'Misc' folder on https://jenkins.contoso.com using the
credentials provided by the user.
RELATED LINKS
SYNOPSIS
Get a list of jobs in a Jenkins master server.
SYNTAX
Get-JenkinsJobList [-Uri] <String> [[-Credential] <PSCredential>] [[-Crumb] <String>] [[-Folder] <String>]
[[-IncludeClass] <String[]>] [[-ExcludeClass] <String[]>] [<CommonParameters>]
DESCRIPTION
Returns the list of jobs registered on a Jenkins Master server in either the root folder or a specified subfolder.
The list of jobs returned can be filtered by setting the IncludeClass or ExcludeClass parameters. By default any
folders will be filtered from this list.
PARAMETERS
-Uri <String>
Contains the Uri to the Jenkins Master server to execute the command on.
Required? true
Position? 2
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Credential <PSCredential>
Contains the credentials to use to authenticate with the Jenkins Master server.
Required? false
Position? 3
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Crumb <String>
Contains a Crumb to pass to the Jenkins Master Server if CSRF is enabled.
Required? false
Position? 4
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Folder <String>
The optional job folder to retrieve the jobs from. This requires the Jobs Plugin to be installed on Jenkins.
Required? false
Position? 5
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-IncludeClass <String[]>
This allows the class of objects that are returned to be limited to only these types.
Required? false
Position? 6
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ExcludeClass <String[]>
This allows the class of objects that are returned to exclude these types.
Required? false
Position? 7
Default value None
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
An array of Jenkins Job objects.
NOTES
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>$Jobs = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Verbose
Returns the list of jobs on https://jenkins.contoso.com using the credentials provided by the user.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$Jobs = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Folder 'Misc' \\`
-Verbose
Returns the list of jobs in the 'Misc' folder on https://jenkins.contoso.com using the credentials provided by the
user.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>$Folders = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Folder 'Misc' \\`
-IncludeClass 'hudson.model.FreeStyleProject' \\`
-Verbose
Returns the list of freestyle Jenknins jobs in the 'Misc' folder on https://jenkins.contoso.com using the
credentials provided by the user.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>$Folders = Get-JenkinsJobList `
-Uri 'https://jenkins.contoso.com' \\`
-Credential (Get-Credential) \\`
-Folder 'Misc\\Builds' \\`
-Verbose
Returns the list of jobs in the 'Builds' folder within the 'Misc' folder on https://jenkins.contoso.com using the
credentials provided by the user.
RELATED LINKS