forked from microsoftgraph/msgraph-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopyFilesOnBuild.ps1
More file actions
30 lines (26 loc) · 973 Bytes
/
copyFilesOnBuild.ps1
File metadata and controls
30 lines (26 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
<#
.Synopsis
Copy files to a new location that is the parent of the current directory.
.Description
Receives an encoded string value and decodes it using base64.
Write the new decoded string to a local file for later consumption.
.Parameter inputPath
The encoded string we wish to decode.
#>
Param(
[Parameter(Mandatory = $true)][string]$inputPath
)
$fullPath = (Get-Item $inputPath).FullName
$parentDirectory = (Get-Item $inputPath).Parent
Push-Location $inputPath
Get-ChildItem '*' -Filter *.java -recurse | ForEach-Object {
$TargetDirectory = $_.DirectoryName.Replace($fullPath, "")
$TargetPath = Join-Path -Path $parentDirectory -ChildPath $TargetDirectory
If (!(Test-Path $TargetPath)) {
New-Item -Path $TargetPath -Type Directory -Force | out-null
}
$_ | Move-Item -Destination $TargetPath -Force
}
Pop-Location