Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit 8994cac

Browse files
committed
Updated postbuild
1 parent e669253 commit 8994cac

File tree

1 file changed

+40
-25
lines changed

1 file changed

+40
-25
lines changed

PostBuild.ps1

+40-25
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,40 @@ if($ConfigurationName -like "Debug*")
2727
Write-Host "Copying files from $TargetDir to $DestinationFolder"
2828
Copy-Item "$TargetDir\*.dll" -Destination "$DestinationFolder"
2929
Copy-Item "$TargetDir\*help.xml" -Destination "$DestinationFolder"
30-
if($ConfigurationName -like "Debug15")
31-
{
32-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2013.psd1" -Destination "$DestinationFolder"
33-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2013.Commands.Format.ps1xml" -Destination "$DestinationFolder"
34-
} elseif($ConfigurationName -like "Debug16")
30+
switch($ConfigurationName)
3531
{
36-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPSPowerShellP2016.psd1" -Destination "$DestinationFolder"
37-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2016.Commands.Format.ps1xml" -Destination "$DestinationFolder"
38-
} else {
39-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellOnline.psd1" -Destination "$DestinationFolder"
40-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.Online.Commands.Format.ps1xml" -Destination "$DestinationFolder"
32+
"Debug15" {
33+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2013.psd1" -Destination "$DestinationFolder"
34+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2013.Commands.Format.ps1xml" -Destination "$DestinationFolder"
35+
}
36+
"Debug16" {
37+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2016.psd1" -Destination "$DestinationFolder"
38+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2016.Commands.Format.ps1xml" -Destination "$DestinationFolder"
39+
}
40+
"Debug" {
41+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellOnline.psd1" -Destination "$DestinationFolder"
42+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.Online.Commands.Format.ps1xml" -Destination "$DestinationFolder"
43+
}
4144
}
4245
} elseif ($ConfigurationName -like "Release*")
4346
{
4447
$documentsFolder = [environment]::getfolderpath("mydocuments");
45-
46-
if($ConfigurationName -like "Release15")
48+
switch($ConfigurationName)
4749
{
48-
$DestinationFolder = "$documentsFolder\WindowsPowerShell\Modules\SharePointPnP.PowerShell.V15.Commands"
49-
} else {
50-
$DestinationFolder = "$documentsFolder\WindowsPowerShell\Modules\SharePointPnP.PowerShell.V16.Commands"
50+
"Release15"
51+
{
52+
$DestinationFolder = "$documentsFolder\WindowsPowerShell\Modules\SharePointPnPPowerShellSP2013"
53+
}
54+
"Release16"
55+
{
56+
$DestinationFolder = "$documentsFolder\WindowsPowerShell\Modules\SharePointPnPPowerShellSP2016"
57+
}
58+
"Release"
59+
{
60+
$DestinationFolder = "$documentsFolder\WindowsPowerShell\Modules\SharePointPnPPowerShellOnline"
61+
}
5162
}
63+
5264
# Module folder there?
5365
if(Test-Path $DestinationFolder)
5466
{
@@ -63,17 +75,20 @@ if($ConfigurationName -like "Debug*")
6375
Write-Host "Copying files from $TargetDir to $DestinationFolder"
6476
Copy-Item "$TargetDir\*.dll" -Destination "$DestinationFolder"
6577
Copy-Item "$TargetDir\*help.xml" -Destination "$DestinationFolder"
66-
if($ConfigurationName -like "Release15")
78+
switch($ConfigurationName)
6779
{
68-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2013.psd1" -Destination "$DestinationFolder"
69-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2013.Commands.Format.ps1xml" -Destination "$DestinationFolder"
70-
} elseif($ConfigurationName -like "Release16")
71-
{
72-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2016.psd1" -Destination "$DestinationFolder"
73-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2016.Commands.Format.ps1xml" -Destination "$DestinationFolder"
74-
} else {
75-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellOnline.psd1" -Destination "$DestinationFolder"
76-
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.Online.Commands.Format.ps1xml" -Destination "$DestinationFolder"
80+
"Release15" {
81+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2013.psd1" -Destination "$DestinationFolder"
82+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2013.Commands.Format.ps1xml" -Destination "$DestinationFolder"
83+
}
84+
"Release16" {
85+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellSP2016.psd1" -Destination "$DestinationFolder"
86+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.SP2016.Commands.Format.ps1xml" -Destination "$DestinationFolder"
87+
}
88+
"Release" {
89+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnPPowerShellOnline.psd1" -Destination "$DestinationFolder"
90+
Copy-Item "$TargetDir\ModuleFiles\SharePointPnP.PowerShell.Online.Commands.Format.ps1xml" -Destination "$DestinationFolder"
91+
}
7792
}
7893
}
7994

0 commit comments

Comments
 (0)