-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakeNewProject.ps1
51 lines (27 loc) · 1.33 KB
/
MakeNewProject.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Remove-Item c:\scripts\* -include .wav,.mp3
# copy-item c:\src\* c:\dst -force -recurse -verbose
Param
(
[Parameter(Mandatory=$true)]
[string] $ProjectName
)
$originalPath = $MyInvocation.MyCommand.Definition
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$destPath = '../../' + $ProjectName
$slnName = $ProjectName + ".sln"
$deletePath = '.\packages\*'
Write-Output $scriptPath
Write-Output $destPath
Copy-Item -Path $scriptPath -Destination $destPath -Exclude *.dll, *.ps1 -Force -Recurse
CD $destPath
Remove-Item $deletePath -exclude *.config -Recurse -Force
Remove-Item .\.vs -Recurse -Force
#Get-Childitem *.* -File -Recurse -Filter *.suo | Foreach-Object {Write-Output $_.FullName}# Foreach-Object {Remove-Item $_.FullName}
#Get-ChildItem *.suo* -recurse | Where { ! $_.PSIsContainer } -Verbose
#Remove-Item -Recurse -Force -Verbose -Filter *.suo -Path .\*
#Remove-Item -Recurse -Force -Verbose .\*.vsp*
#Remove-Item -Recurse -Force -Verbose .\*.vss*
Rename-Item -NewName $slnName -Path Sabio.Starter.Template.sln -Force
Remove-Item .\*.ps1 -Force
CD $scriptPath
Write-Warning "You still have to delete all the *.vsp and *.vss files, the .vs folder, this *.suo files as well as removing the solution from Source countrol bindings."