New-AzGalleryInVMAccessControlProfileVersion

Skapar en ny version av ett galleri iVMAccessControlProfile.

Syntax

Default (Standard)

New-AzGalleryInVMAccessControlProfileVersion
    -ResourceGroupName <String>
    -GalleryName <String>
    -GalleryInVMAccessControlProfileName <String>
    -GalleryInVmAccessControlProfileVersion <PSGalleryInVMAccessControlProfileVersion>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Cmdleten New-AzGalleryInVMAccessControlProfileVersion skapar en ny version av ett galleri inVMAccessControlProfile i Azure.
Den här cmdleten använder PSGalleryInVMAccessControlProfileVersion-objekt som skapats från New-AzGalleryInVMAccessControlProfileVersionConfig som indata.

Add-AzGalleryInVMAccessControlVersionRulesIdentity, Add-AzGalleryInVMAccessControlVersionRulesPrivilege, Add-AzGalleryInVMAccessControlVersionRulesRole och Add-AzGalleryInVMAccessControlVersionRulesRoleAssignment-cmdletar kan också användas för att lägga till regler i PSGalleryInVmAccessControlProfileVersion-objektet.

Exempel

Exempel 1

New-AzGalleryInVMAccessControlProfileVersion -ResourceGroupName "myResourceGroup" -GalleryName "myGallery" -GalleryInVMAccessControlProfileName "myProfile" -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion

Skapar en version av ett galleri iVMAccessControlProfile.

Exempel 2

$rgname = "myResourceGroup"
$location = "West US 2"
$galleryName = "myGallery"
$inVMAccessProfileName = "myProfile"
$inVMAccessProfileVersionName = "myProfileVersion"

# Create a gallery
New-AzGallery -ResourceGroupName $rgname -GalleryName $galleryName -Location $location -Description "My custom image gallery"

# Create a gallery inVMAccessControlProfile
New-AzGalleryInVMAccessControlProfile -ResourceGroupName  $rgname -GalleryName $galleryName -GalleryInVMAccessControlProfileName $InVMAccessControlProfileName -Location $location -OsType "Windows" -ApplicableHostEndPoint "WireServer"

# Create a gallery inVMAccessControlProfile version config
$inVMAccessControlProfileVersion = New-AzGalleryInVMAccessControlProfileVersionConfig -Name $inVMAccessControlProfileVersionName -Location $location -Mode "Audit" -DefaultAccess "Deny" -TargetLocation @("Wesut US2", "West US") -ExcludeFromLatest

# Add rules to PSGalleryInVMAccessControlProfileVersion
Add-AzGalleryInVMAccessControlProfileVersionRulesPrivilege -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -PrivilegeName "GoalState" -Path "/machine" -QueryParameter @{ comp = "goalstate" }
Add-AzGalleryInVMAccessControlProfileVersionRulesRole -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -RoleName "Provisioning" -Privilege @("GoalState")
Add-AzGalleryInVMAccessControlProfileVersionRulesIdentity -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -IdentityName "WinPA" -UserName "SYSTEM" -GroupName "Administrators" -ExePath "C:\Windows\System32\cscript.exe" -ProcessName "cscript"
Add-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -Role "Provisioning" -Identity @("WinPA")

# Create the gallery inVMAccessControlProfile version resource in Azure
New-AzGalleryInVMAccessControlProfileVersion -ResourceGroupName $rgname -GalleryName $galleryName -GalleryInVMAccessControlProfileName $inVMAccessProfileName -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion

Skapar en fullständig Konfiguration av InVM-Access Control profil genom att först skapa ett galleri och En InVM-Access Control profil, sedan skapa en konfiguration av lokal profilversion med regler och slutligen distribuera den till Azure.

Parametrar

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:jfr

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Parameteregenskaper

Typ:IAzureContextContainer
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:AzContext, AzureRmContext, AzureCredential

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-GalleryInVMAccessControlProfileName

Namnet på galleriet i den virtuella datorn Access Control profil.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-GalleryInVmAccessControlProfileVersion

PSGalleryInVmAccessControlProfileVersion-objekt som skapats från New-AzGalleryInVMAccessControlProfileVersionConfig.

Parameteregenskaper

Typ:PSGalleryInVMAccessControlProfileVersion
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-GalleryName

Galleriets namn.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-ResourceGroupName

Namnet på resursgruppen.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-WhatIf

Visar vad som skulle hända om kommandot körs. Cmdleten körs inte.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:Wi

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

CommonParameters

Den här cmdleten stöder vanliga parametrar: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction och -WarningVariable. Mer information finns i about_CommonParameters.

Indata

String

PSGalleryInVMAccessControlProfileVersion

Utdata

PSGalleryInVMAccessControlProfileVersion