Copy file parameters




















No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. Returns an object that represents the item with which you're working. By default, this cmdlet doesn't generate any output. Specifies the PSSession object to which a remote file is being copied.

When you use this parameter, the Destination parameter refers to the local path on the remote machine. When you use the PassThru parameter, this cmdlet returns an object that represents the copied item.

Otherwise, this cmdlet doesn't generate any output. This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type Get-PSProvider. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Copy-Item Reference Is this page helpful? Please rate your experience Yes No. Any additional feedback? Module: Microsoft. Copies an item from one location to another. Prompts you for confirmation before running the cmdlet.

Note This parameter is not supported by any providers installed with PowerShell. Specifies the path to the new location.

The default is the current directory. Specifies, as a string array, the path to the items to copy. Indicates that this cmdlet does a recursive copy. Shows what would happen if the cmdlet runs.

If both arguments to copy are not file handles, then copy will perform a "system copy" of the input file to a new output file, in order to preserve file attributes, indexed file structure, etc. The buffer size parameter is ignored. If either argument to copy is a handle to an opened file, then data is copied using Perl operators, and no effort is made to preserve file attributes or record structure. The first and second arguments may be strings, typeglobs, typeglob references, or objects inheriting from IO::Handle; they are used in all cases to obtain the filespec of the input and output files, respectively.

The name and type of the input file are used as defaults for the output file, if necessary. A new version of the output file is always created, which inherits the structure and RMS attributes of the input file, except for owner and protections and possibly timestamps; see below. All data from the input file is copied to the output file; if either of the first two parameters to rmscopy is a file handle, its position is unchanged. Note that this means a file handle pointing to the output file will be associated with an old version of that file after rmscopy returns, not the newly created version.

The third parameter is an integer flag, which tells rmscopy how to handle timestamps. If the third parameter to rmscopy is 0, then it behaves much like the DCL COPY command: if the name or type of the output file was explicitly specified, then no timestamps are propagated, but if they were taken implicitly from the input filespec, then all timestamps other than the revision date are propagated. If this parameter is not supplied, it defaults to 0.

Like copy , rmscopy returns 1 on success. Before calling copy or move on a filehandle, the caller should close or flush the file to avoid writes being lost. Note that this is the case even for move , because it may actually copy the file, depending on the OS-specific implementation, and the underlying filesystem s. Please contact him via the GitHub issue tracker or email regarding any issues with the site itself, search, or rendering of documentation.

Once the above command is typed in, a user could type in whatever he or she wishes. Note The copy command is used for complete files, if you want to copy a directory , or multiple directories containing files, use the robocopy or xcopy command. Availability Copy syntax Copy examples. Windows Vista and later syntax Windows XP and earlier syntax. Note If there are hidden files , they're not copied. Related information How to copy, move, or rename files with a space in the name.

See our copy definition for further information and related links on this term. Specifies the directory or file name for the new file s.



0コメント

  • 1000 / 1000