PackageDeployment Module Help

Package Deployment Module (DSM eScript Commands)

Copy-File Cmdlet

Version 1.0.0.3

Copy-File

Synopsis

Copy Files

Syntax

Copy-File [-File] <String> [-TargetDir] <String> [[-Replace] <String>] [-ContinueOnError] [-CreateBackup] [-Recurse] [-Wow64] [[-Context] <String>] [<CommonParameters>]

Description

Use this command to copy one or more files to a destination directory. This command works in the same way as the DOS command COPY and also uses the same syntax. You can use wildcards, environment variables and all variables, such as windir, winsysdir etc.

Parameters

-Context <String>

User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user.
UserPerService: User-related command, execution with DSM Runtime Service.
Computer: Execution under user account; logging in HKEY_CURRENT_MACHINE, i.e. for the computer.
Computer: Execution with DSM Runtime Service; logging in HKEY_LOCAL_MACHINE, i.e. for the computer.

Required

False

Position

3

Accepts pipeline input

False

-ContinueOnError <SwitchParameter>

Continues script execution in spite of errors in the respective command

Required

False

Position

Named

Accepts pipeline input

False

-CreateBackup <SwitchParameter>

Creates backup files of all files updated by a copying process.

Required

False

Position

Named

Accepts pipeline input

False

-File <String>

The source file to be installed are specified in the form of a list. Wildcards (? *) and variables can be used.

Required

True

Position

0

Accepts pipeline input

False

-Recurse <SwitchParameter>

This option is only used for 32 bit operations (Win9x, WinNT4.x, NT-Service, Windows 2000/XP). When using this command with the DSM Runtime Service, please read the Notes on using the DSM Runtime Service.

Required

False

Position

Named

Accepts pipeline input

False

-Replace <String>

Always: Files with identical names in the target directory will always be replaced.
Note: If you select the options "Always replace" or "Replace older versions only", you additionally switch to the unattended mode. In this mode, the DSM automatically checks whether the files to be installed are currently in use (and therefore cannot be installed while Windows is running). The respective files are listed; Windows is automatically restarted and the files are installed. Use the Unregister-SystemRestart command to avoid the automatic restart.
Older: This option allows you to compare file versions (of existing files). First, the Installer compares the internal versions of the files (if maintained). If the internal versions have not been maintained, the Installer compares the date and time of files having identical names. If an older file version exists it will be replaced with the newer version.
Note: If you select the options "Always replace" or "Replace older versions only", you additionally switch to the unattended mode. In this mode, the DSM automatically checks whether the files to be installed are currently in use (and therefore cannot be installed while Windows is running). The respective files are listed; Windows is automatically restarted and the files are installed. Use the Unregister-SystemRestart command to avoid the automatic restart.
Never: Files with identical names in the target directory will not be replaced.
Confirm: Files with identical names in the target directory will replaced only if the user confirms.

Required

False

Position

2

Accepts pipeline input

False

-TargetDir <String>

The specified source files are installed in the common target path. An installation in subdirectories is not possible.

Required

True

Position

1

Accepts pipeline input

False

-Wow64 <SwitchParameter>

For reasons of compatibilty, Ivanti DSM maps file and registry access to the default storage location for 32 bit applications (provided that the storage location differs from that of 64-bit applications). File access: whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64. Registry commands: when accessing HKEY_LOCAL_MACHINE\SOFTWARE the calls are redirected to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node. The x64-switch stops this redirection of file and registry accesses when running the script command on a x64 computer; the eScript command runs on the specified path. CallScript command: the script runs in a 64-bit process.

Required

False

Position

Named

Accepts pipeline input

False

<CommonParameters>

For more information about common parameters, type "Get-Help about_CommonParameters".