Table of contents
ISE
TOC
Collapse the table of content
Expand the table of content

Move-Item for Certificate

JuanPablo Jofre|Last Updated: 11/17/2016
|
1 Contributor

Moves certificates from one certificate store to another certificate store.

Syntax

Move-Item [-Path] <string[]> [[-Destination] <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

Description

In the Cert: drive, Move-Item moves certificates from one certificate store to another certificate store. The Windows PowerShell Certificate Provider adds the Cert: drive to Windows PowerShell.

Beginning in Windows PowerShell 3.0, the Certificate provider enhances its support for managing Secure Socket Layer (SSL) certificates for web hosting by enabling you to use the Move-Item cmdlet to move certificates between certificate stores. You cannot use this feature to move a certificate to a different certificate store location, such as a move from LocalMachine to CurrentUser, or to move certificate stores. Also, Move-Item does not move private keys.

NOTE: In the Cert: drive, only the Path, Destination, WhatIf, and Confirm parameters of the Move-Item cmdlet are effective. All other parameter and parameter values are ignored.

Parameters

-Destination <_string5c_>

Specifies the path to the location where the items are being moved. The default is the current certificate store. Wildcards

are permitted, but the result must specify a single location.

To rename the item that is being moved, specify a new name in the value of the Destination parameter.

Required?false
Position?2
Default ValueCurrent certificate store
Accept Pipeline Input?true (ByValue, ByPropertyName)
Accept Wildcard Characters?false

-Path <_string5b_5d_>

Specifies the path to the original location of the certificate. Wildcards are permitted.

Required?true
Position?1
Default ValueNone
Accept Pipeline Input?true (ByValue, ByPropertyName)
Accept Wildcard Characters?false

-Confirm

Prompts you for confirmation before executing the command.

Required?false
Position?named
Default Value
Accept Pipeline Input?false
Accept Wildcard Characters?false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?false
Position?named
Default Value
Accept Pipeline Input?false
Accept Wildcard Characters?false

<_commonparameters5c_>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs and Outputs

The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.

InputsSystem.String

You can pipe a certificate path to the Move-Item cmdlet.
OutputsNone

This cmdlet does not generate any output.

Notes

-- Beginning in Windows PowerShell 3.0, the Microsoft.PowerShell.Security module that contains the Cert: drive is not imported automatically into every session. To use the Cert: drive, use the Import-Module cmdlet to import the module, or run a command that uses the Cert: drive, such as a "Set-Location Cert:" command.

Example 1

C:\PS>Move-Item -Path cert:\LocalMachine\My\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 -Destination cert:\LocalMachine\WebHosting  

Description  
-----------  
This command uses the Move-Item cmdlet to move a certificate from the My store to the WebHosting store.   

Because the command uses absolute paths, you can run it from any Windows PowerShell drive. You can also run it from a Cert: drive path and use relative paths.

Example 2

C:\PS>Get-ChildItem -Path cert:\LocalMachine\My -EKU "Server Authentication" | Move-Item -Destination cert:\LocalMachine\WebHosting  

Description  
-----------  
This command uses the EKU parameter of the Get-ChildItem cmdlet to get SSL server authentication certificates in the MY certificate store.  

It uses a pipeline operator to send the certificates to the Move-Item cmdlet, which moves the certificates to the WebHosting store.

See Also

Certificate Provider
Get-ChildItem
Get-Item
Get-PfxCertificate
Get-PSDrive
New-Item
Remove-Item

© 2016 Microsoft