你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzDevCenterAdminCatalog
创建或更新目录。
语法
New-AzDevCenterAdminCatalog
-DevCenterName <String>
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-AdoGitSecretIdentifier <String>
-AdoGitUri <String>
[-AdoGitBranch <String>]
[-AdoGitPath <String>]
[-SyncType <CatalogSyncType>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzDevCenterAdminCatalog
-DevCenterName <String>
-Name <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-SyncType <CatalogSyncType>]
[-Tag <Hashtable>]
-GitHubSecretIdentifier <String>
-GitHubUri <String>
[-GitHubBranch <String>]
[-GitHubPath <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzDevCenterAdminCatalog
-InputObject <IDevCenterIdentity>
-AdoGitSecretIdentifier <String>
-AdoGitUri <String>
[-AdoGitBranch <String>]
[-AdoGitPath <String>]
[-SyncType <CatalogSyncType>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzDevCenterAdminCatalog
-InputObject <IDevCenterIdentity>
[-SyncType <CatalogSyncType>]
[-Tag <Hashtable>]
-GitHubSecretIdentifier <String>
-GitHubUri <String>
[-GitHubBranch <String>]
[-GitHubPath <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建或更新目录。
示例
示例 1:创建 Azure Dev Ops 目录
New-AzDevCenterAdminCatalog -DevCenterName Contoso -Name CentralCatalog -ResourceGroupName testRg -AdoGitBranch main -AdoGitPath "/templates" -AdoGitSecretIdentifier "https://contosokv.vault.azure.net/secrets/CentralRepoPat" -AdoGitUri "https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso"
在开发人员中心“Contoso”中创建名为“CentralCatalog”的 Azure Dev Ops 目录。
示例 2:创建 GitHub 目录
New-AzDevCenterAdminCatalog -DevCenterName Contoso -Name CentralCatalog -ResourceGroupName testRg -GitHubBranch main -GitHubPath "/templates" -GitHubSecretIdentifier "https://contosokv.vault.azure.net/secrets/CentralRepoPat" -GitHubUri "https://github.com/Contoso/centralrepo-fake.git"
此命令在开发人员中心“Contoso”中创建名为“CentralCatalog”的 GitHub 目录。
示例 3:使用 InputObject 创建 Azure Dev Ops 目录
$catalog = @{"ResourceGroupName" = "testRg"; "DevCenterName" = "Contoso"; "CatalogName" = "CentralCatalog"; "SubscriptionId" = "0ac520ee-14c0-480f-b6c9-0a90c58ffff"}
New-AzDevCenterAdminCatalog -InputObject $catalog -AdoGitBranch main -AdoGitPath "/templates" -AdoGitSecretIdentifier "https://contosokv.vault.azure.net/secrets/CentralRepoPat" -AdoGitUri "https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso"
此命令在开发人员中心“Contoso”中创建名为“CentralCatalog”的 Azure Dev Ops 目录。
示例 4:使用 InputObject 创建 Github 目录
$catalog = @{"ResourceGroupName" = "testRg"; "DevCenterName" = "Contoso"; "CatalogName" = "CentralCatalog"; "SubscriptionId" = "0ac520ee-14c0-480f-b6c9-0a90c58ffff"}
New-AzDevCenterAdminCatalog -InputObject $catalog -GitHubBranch main -GitHubPath "/templates" -GitHubSecretIdentifier "https://contosokv.vault.azure.net/secrets/CentralRepoPat" -GitHubUri "https://github.com/Contoso/centralrepo-fake.git"
此命令在开发人员中心“Contoso”中创建名为“CentralCatalog”的 GitHub 目录。
参数
-AdoGitBranch
Git 分支。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AdoGitPath
可以在存储库中找到目录项的文件夹。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AdoGitSecretIdentifier
对 Key Vault 机密的引用,其中包含用于向 Git 存储库进行身份验证的安全令牌。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-AdoGitUri
Git URI。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-AsJob
以作业身份运行命令
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
DefaultProfile 参数不起作用。 如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
类型: | PSObject |
别名: | AzureRMContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DevCenterName
开发中心的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-GitHubBranch
Git 分支。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GitHubPath
可以在存储库中找到目录项的文件夹。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-GitHubSecretIdentifier
对 Key Vault 机密的引用,其中包含用于向 Git 存储库进行身份验证的安全令牌。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-GitHubUri
Git URI。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-InputObject
要构造的标识参数,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。
类型: | IDevCenterIdentity |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
目录的名称。
类型: | String |
别名: | CatalogName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NoWait
异步运行命令
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称。 名称不区分大小写。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
目标订阅的 ID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SyncType
指示为目录配置的同步类型。
类型: | CatalogSyncType |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Tag
资源标记。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |