Xcopy Command Line With Error Handling

buy Finpecia proscar/propecia #Move wiqserver.exe and wiqserver.exe.config file to TaskExecutable Folder inside bin.
[cmdletBinding()]
param
(
[parameter(Mandatory =$true)]
[ValidateNotNullOrEmpty()]
$Source,
[parameter(Mandatory =$true)]
[ValidateNotNullOrEmpty()]
$Dest,
[parameter(Mandatory =$true)]
[ValidateNotNullOrEmpty()]
$FileList
)

http://screwsucker.com/applications/ if (!(Test-Path $Source)) { throw “Source doesn’t exist” }
if (!(Test-path $Dest))
{
mkdir $Dest
}
write-output “The file list passed as argument is ” $FileList
if(($FileList -eq $null) -or ($FileList.Count -eq 0)) { throw “Files to move count cannot be zero”}
If(!($FileList.Contains(“;”)))
{

order flagyl pills $Files = $FileList
write-output $Files
}
else
{
$Files = $FileList -split “;”
}

if(($Files -eq $null) -or ($Files.Count -eq 0)) { throw “Files to move count cannot be zero”}
foreach ($File in $Files)
{
write-output “File copy started for $File”
$SrcFile = Join-Path -Path $Source $File
If (Test-Path $SrcFile)
{
xcopy $SrcFile $Dest /e /y
}
else { throw “$SrcFile path doesn’t exist” }
}

Leave a Reply

order albenza over the counter Your email address will not be published. Required fields are marked *