• Narrow screen resolution
  • Wide screen resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
© Diana Scherff, Amas-Veritas.com

Welcome to Amas Veritas [dot] com

Updates: Media (lyrics) has a new layout. I could never figure out how to lay it out, but it's easier to navigate now. I'm still working on a better duplicate Mamblog mod. I'm trying to make submittions easier but the poetry form died for some reason. Quizzes are also on their way from the old site. Joomla content isn't very code friendly so I'm having to rewrite old code. You can still click on News > AH v21 > Screen if you wish to use the quizzes.
 
Home arrow Tools arrow Windows PowerShell arrow Copy-Item [cpi]
Copy-Item [cpi] Print E-mail
Written by Diana, on 03-09-2007 23:35
Views 140    
Favoured None

PS C:\Users\Admin> help cpi -full

NAME
    Copy-Item

SYNOPSIS
    Copies an item from one location to another within a namespace.

SYNTAX
    Copy-Item [-path] <string[]> [[-destination] <string>] [-container] [-recurse] [-force] [-include <string[]>] [-exclude <string[]>] [-filter <string>] [-passThru] [-credential <PSCredential>] [-whatIf] [-confirm] [<CommonParameters>]

    Copy-Item [-literalPath] <string[]> [[-destination] <string>] [-container] [-recurse] [-force] [-include <string[]>] [-exclude <string[]>] [-filter <string>] [-passThru] [-credential <PSCredential>] [-whatIf] [-confirm] [<CommonParameters>]


DETAILED DESCRIPTION
    Copies an item from one location to another in a namespace. Copy-Item does not delete the items being copied. The particular items that the cmdlet can copy depend on the Windows PowerShell providers available. For example, when used with the FileSystem provider, it can copy files and directorie
    s and when used with the Registry provider, it can copy registry keys and entries.


PARAMETERS
    -path <string[]>
        Specifies the path to the items to copy.

        Required?                    true
        Position?                    1
        Default value                N/A - The path must be specified.
        Accept pipeline input?       true (ByValue, ByPropertyName)
        Accept wildcard characters?  true

    -destination <string>
        Specifies the path to where the items are to be copied.

        Required?                    false
        Position?                    2
        Default value                <Current location>
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false

    -container <SwitchParameter>
        Preserves container objects during the copy operation.

        Required?                    false
        Position?                    named
        Default value                True
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -recurse <SwitchParameter>
        Specifies a recursive copy.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -force <SwitchParameter>
        Allows cmdlet to override restrictions such as renaming existing files as long as security is not compromised.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -include <string[]>
        Specifies only those items upon which the cmdlet will act, excluding all others.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -exclude <string[]>
        Omits the specified items. Wildcards are permitted.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -filter <string>
        Specifies filter elements as required and supported by providers.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -passThru <SwitchParameter>
        Passes the object created by this cmdlet through the pipeline. By default, this cmdlet does not pass any objects through the pipeline.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -credential <PSCredential>
        The credential is used to validate access. If a PSCredential object obtained earlier using get-credential is supplied, it will be used as is. If a user name is supplied,  there will be a prompt for a password.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false

    -literalPath <string[]>
        Specifies a path to the item. The value of -LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?       true (ByPropertyName)
        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

    -confirm
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?      false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".


INPUT TYPE
    String


RETURN TYPE



NOTES


        Copy-Item  is like the 'cp' or 'copy' commands in other shells.

        For more information, type "Get-Help Copy-Item -detailed". For technical information, type "Get-Help Copy-Item -full".

        When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".


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

    C:\PS>copy-item C:\Wabash\Logfiles\mar1604.log.txt -destination C:\Presentation


    This command will copy the file mar1604.log.txt to the C:\Presentation directory. The command does not delete the original file.





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

    C:\PS>copy-item C:\Logfiles -destination C:\Drawings -recurse


    This command copies the entire contents of the Logfiles directory into the Drawings directory. If the source directory contains files in subdirectories, those subdirectories will be copied with their file trees intact. The -container parameter is set to true by default. This preserves the directory structure.


    None.


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

    C:\PS>copy-item C:\Logfiles -destination C:\Drawings\Logs -recurse


    This command copies the contents of the C:\Logfiles directory to the C:\Drawings\Logs directory. It will create the subdirectory \Logs if it does not already exist.






RELATED LINKS
    Clear-Item
    Get-Item
    Invoke-Item
    Move-Item
    Set-Item
    New-Item
    Remove-Item
    Rename-Item
    about_namespace


Last update: 03-09-2007 23:35

Published in : Tools, Windows PowerShell

Users' Comments (0) RSS feed comment

No comment posted

Add your comment



mXcomment 1.0.4 © 2007-2009 - visualclinic.fr
License Creative Commons - Some rights reserved
 
< Prev   Next >




Double click any word on this page for a definition.
Using Firefox? Enable definitions by downloading the extension.
Sorry, this feature does not currently work in Opera or Safari.

No Users Online

Statistics

OS: FreeBSD
PHP: 5.2.1
MySQL: 4.1.21-log
Time: 21:09
Caching: Disabled
GZIP: Disabled
Members: 36
News: 2448
Web Links: 39
Visitors: 1443397

Syndicate

Login

Particls