< Back

New-JenkinsFolder

Wed Jan 15, 2020 10:39 am

NAME New-JenkinsFolder



SYNOPSIS

Create a new Jenkins Folder.





SYNTAX

New-JenkinsFolder [-Uri] <String> [[-Credential] <PSCredential>] [[-Crumb] <String>] [[-Folder] <String>] [-Name]

<String> [[-Description] <String>] [[-XML] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Creates a new Jenkins Folder with the specifed Name and optional Description. If a folder is specified it will

create the new folder inside the specified folder. If the folder already exists an error will occur. If XML is

provided then the XML will be used instead of being generated automatically from the Name and description. This

requires the Jobs Plugin to be installed on Jenkins.





PARAMETERS

-Uri <String>

Contains the Uri to the Jenkins Master server to set the Job definition 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 folder the new folder will be created in. If the folder does not exist then an error will occur.



Required? false

Position? 5

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

The name of the new folder to create.



Required? true

Position? 6

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

The optional description of the new folder to create.



Required? false

Position? 7

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-XML <String>

The optional config XML for the new folder. This allows additional properties to be set on the folder.



Required? false

Position? 8

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

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

None.







NOTES









-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-JenkinsFolder `

-Uri 'https://jenkins.contoso.com' \\`

-Credential (Get-Credential) \\`

-Name 'Management' \\`

-Description 'Management jobs' \\`

-Verbose



Creates a new folder on https://jenkins.contoso.com using the credentials provided by the user.

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-JenkinsFolder `

-Uri 'https://jenkins.contoso.com' \\`

-Credential (Get-Credential) \\`

-Folder 'Apps' \\`

-Name 'Management' \\`

-Description 'Management jobs' \\`

-Verbose



Creates a new folder in the 'Apps' folder on https://jenkins.contoso.com using the credentials provided by the

user.



RELATED LINKS