< Back

New-GceNetwork

Mon Jan 13, 2020 11:27 pm

NAME New-GceNetwork



SYNOPSIS

Creates a new Google Compute Engine network.





SYNTAX

New-GceNetwork [-Project <string>] [-Name] <string> [-Description <string>] [-IPv4Range <string>] [-AutoSubnet

<SwitchParameter>] [<CommonParameters>]





DESCRIPTION

Creates a new Google Compute Engine network. The cmdlet will create the network in the default project if -Project

is not used. By default, the network is created in without any subnets. To create a network with subnets

automatically created, use -AutoSubnet switch. To create a network in legacy mode, which has a range and cannot

have subnets, use the -IPv4Range parameter. Please note that using legacy network is not recommended as many newer

Google Cloud Platform features are not supported on legacy networks and legacy networks may not be supported in

the future.





PARAMETERS

-Project <string>

The project to create the network in. Defaults to the gcloud config project.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <string>

The name of the network to be created.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Network <string>

The name of the network to be created.



This is an alias of the Name parameter.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Description <string>

The description of the network to be created.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-IPv4Range <string>

The IPv4 range of the network. Please note that using this parameter will create a legacy network that has

range and cannot have subnets. This is not recommended as many Google Cloud features are not available on

legacy networks.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AutoSubnet <SwitchParameter>

If set to true, the network created will its subnets created automatically.



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

System.String

The name of the network to be created.





OUTPUTS

Google.Apis.Compute.v1.Data.Network





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



PS C:\\> New-GceNetwork -Name "my-network"



Creates network "my-network" in the default project.

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



PS C:\\> New-GceNetwork -Name "my-network" -Project "my-project" -AutoSubnet



Creates a network "my-network" with auto subnet created in the project "my-project".

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



PS C:\\> New-GceNetwork -Name "my-network" -IPv4Range 192.168.0.0/16



Creates a network "my-network" IPv4 range of 192.168.0.0/16.



RELATED LINKS

[Networks] (https://cloud.google.com/compute/docs/vpc/)

[Legacy Networks] (https://cloud.google.com/compute/docs/vpc/legacy)