Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Move-Recursively
- {
- [CmdletBinding()]
- param
- (
- [Parameter(Mandatory = $true)]
- [string]
- $Source,
- [Parameter(Mandatory = $true)]
- [string]
- $Destination
- )
- $split = [regex]::escape([io.path]::getfilename($Source))
- $arr = $_.DirectoryName -split "($split)"
- $c = -join $arr[2..$arr.Length]
- $fdst = $Destination + $c
- if (-not (Test-Path -LiteralPath $fdst))
- {
- New-Item -Path $fdst -ItemType Directory -Force
- }
- Move-Item -LiteralPath $Source.FullName -Destination $fdst -Force
- $Source = Get-Item -LiteralPath $Source
- $Destination = Get-Item -LiteralPath $Destination
- # Moving files saving structure
- Get-ChildItem -LiteralPath $_.FullName -Recurse -File -Force | Move-Recursively $Source.FullName $Destination.FullName
- }
- # Исходный и целевой каталоги
- $Source = "$DownloadsFolder\Metro\UPMetroSkin-master\Unofficial 4.x Patch\Main Files [Install First]"
- $Destination = "$DownloadsFolder\Metro\metro-for-steam-4.4"
- Move-Recursively -Source $Source -Destination $Destination
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement