Copy-LMDevice
Syntax
Copy-LMDevice [-Name] <String> [[-DisplayName] <String>] [[-Description] <String>] [-DeviceObject] <Object> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The Copy-LMDevice function creates a new device based on an existing device’s configuration. It allows you to specify a new name, display name, and description while maintaining other settings from the source device.
Examples
Example 1
#Copy a device with basic settingsCopy-LMDevice -Name "NewDevice" -DeviceObject $deviceObject
Example 2
#Copy a device with custom display name and descriptionCopy-LMDevice -Name "NewDevice" -DisplayName "New Display Name" -Description "New device description" -DeviceObject $deviceObject
Parameters
-Name
The name for the new device. This parameter is mandatory.
Type: StringParameter Sets: (All)Aliases:
Required: TruePosition: 1Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DisplayName
The display name for the new device. If not specified, defaults to the Name parameter value.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 2Default value: $NameAccept pipeline input: FalseAccept wildcard characters: False
-Description
An optional description for the new device.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 3Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DeviceObject
The source device object to copy settings from. This parameter is mandatory.
Type: ObjectParameter Sets: (All)Aliases:
Required: TruePosition: 4Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None. You cannot pipe objects to this command.
Outputs
Returns the newly created device object.
Notes
Masked custom properties from the source device will need to be manually updated on the new device as they are not available via the API.