internal/functions/Copy-CFXFSLogixProvider.ps1
function Copy-CFXFSLogixProvider { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $DiskPath, [Parameter(Mandatory = $true)] [string[]] $ProviderPath ) $diskItem = Get-Item -Path $DiskPath foreach ($path in $ProviderPath) { $measure = Measure-Command -Expression { $null = New-Item -Path (Split-Path -Path $DiskPath -ItemType Directory) -Force -ErrorAction Stop Copy-Item -Path $DiskPath -Destination $path -Force -ErrorAction Stop } [PSCustomObject]@{ ProviderPath = $path CopyDuration = "{0}:{1}:{2}.{3}" -f $measure.Hours, $measure.Minutes, $measure.seconds, $measure.Milliseconds CopySpeedMBps = ($diskItem.length / 1MB) / $measure.TotalSeconds } } } |