Skip to content

Instantly share code, notes, and snippets.

@mdimai666
Created January 24, 2020 23:02
Show Gist options
  • Save mdimai666/c408b912bb2838edc4403e90bedd5cce to your computer and use it in GitHub Desktop.
Save mdimai666/c408b912bb2838edc4403e90bedd5cce to your computer and use it in GitHub Desktop.
copy file to one drive with new name for test on device
using namespace System.IO
$oneDriveDir = 'C:\Users\D\OneDrive\AMAI\Share\MR'
Write-Output "copy apk"
$dateStamp = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$fName = 'src-cordova\platforms\android\app\build\outputs\apk\release\app-release.apk'
$source = (Get-ChildItem $fName).FullName
$destination = [System.IO.Path]::GetDirectoryName($source)
$ext = [Path]::GetExtension($source)
$newName = 'release-mr-' + $dateStamp + $ext
$destination = [Path]::Combine($oneDriveDir, $newName)
Write-Output "Copy to -> $destination"
Copy-Item $source $destination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment