- Notifications
You must be signed in to change notification settings - Fork 187
/
Copy pathCleanUpModuleSrc.ps1
26 lines (22 loc) · 733 Bytes
/
CleanUpModuleSrc.ps1
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
[CmdletBinding()]
Param(
[switch] $RemoveReadme
)
$SrcPath=Join-Path$PSScriptRoot"..\src\*\*"
# Remove all items in resource directory except for its root readme.md
Get-Item"$SrcPath\*"|ForEach-Object {
if ($_.Name-ne"readme.md") {
Remove-Item$_.FullName-Recurse
}
}
# Remove all project references from resource solution.
Get-Item"$SrcPath`.sln"|ForEach-Object {
$SolutionFile=$_.FullName
$SolutionPath=$_.Directory
$SolutionProjects= dotnet sln $SolutionFile list
$SolutionProjects|ForEach-Object {
dotnet sln $SolutionFile remove (Join-Path$SolutionPath$_)
}
}