Skip to content

Commit 701debb

Browse files
committed
Update build target
1 parent d18f045 commit 701debb

3 files changed

Lines changed: 30 additions & 64 deletions

File tree

Set-ApiKey.ps1

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/PSModuleTemplate/PSModuleTemplate.fsproj

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<PublishTrimmed>true</PublishTrimmed>
@@ -43,28 +43,12 @@
4343
DestinationFolder="$(OutputPath)" />
4444
<Exec Command='pwsh -noni -nop -c "cd ..\..; Invoke-Pester"'
4545
IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" />
46+
<Exec Command='powershell -noni -nop -c "cd ..\..; Invoke-Pester"'
47+
IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" />
4648
</Target>
4749

4850
<ItemGroup>
4951
<PSModulePath Include="$(PSModulePath)" Exclude="C:\Program Files\**;C:\Windows\**;C:\ProgramData\chocolatey\**" />
5052
</ItemGroup>
5153

52-
<Target Name="PublishModule" DependsOnTargets="Publish" Condition="'$(Configuration)' == 'Release'">
53-
<RemoveDir Directories="@(PSModulePath-&gt;'%(FullPath)\$(MSBuildProjectName)')" />
54-
<Copy SourceFiles="$(OutputPath)\publish\FSharp.Core.dll" DestinationFolder="$(OutputPath)" />
55-
<ItemGroup><ModuleFiles Include="$(OutputPath)\*" /></ItemGroup>
56-
<Copy SourceFiles="@(ModuleFiles)" DestinationFolder="@(PSModulePath-&gt;'%(FullPath)\$(MSBuildProjectName)\$(Version)')" />
57-
<Exec Command='pwsh -noni -nop -c "[bool](Get-SecretInfo $(MSBuildProjectName) -Vault PowerShellGallery)"'
58-
ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true">
59-
<Output TaskParameter="ConsoleOutput" PropertyName="HasApiKey" />
60-
</Exec>
61-
<Error Text="To publish, first run: .\Set-ApiKey.ps1" Condition="!$(HasApiKey)" />
62-
<Exec Command='pwsh -nop -c "(New-Object PSCredential _,(Get-Secret $(MSBuildProjectName) -Vault PowerShellGallery)).GetNetworkCredential().Password"'
63-
ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" Condition="$(HasApiKey)">
64-
<Output TaskParameter="ConsoleOutput" PropertyName="ApiKey" />
65-
</Exec>
66-
<Exec Command='pwsh -noni -nop -c "Import-Module $(MSBuildProjectName); Publish-Module -Name $(MSBuildProjectName) -NuGetApiKey $(ApiKey)"'
67-
IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" Condition="$(HasApiKey)" />
68-
</Target>
69-
7054
</Project>
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# see https://docs.microsoft.com/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest
2-
# and https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-modulemanifest
3-
@{
4-
RootModule = 'PSModuleTemplate.dll'
5-
ModuleVersion = '1.0.0'
6-
CompatiblePSEditions = @('Core')
7-
GUID = 'f5c914f0-8410-48a6-8321-6fe8b4e80cf3'
8-
Author = 'AuthorName'
9-
CompanyName = 'Unknown'
10-
Copyright = '(c) AuthorName. All rights reserved.'
11-
Description = 'A description of this module template.'
12-
PowerShellVersion = '6.0'
13-
FunctionsToExport = @()
14-
CmdletsToExport = @('Get-Foo')
15-
VariablesToExport = @()
16-
AliasesToExport = @()
17-
FileList = @('PSModuleTemplate.dll','PSModuleTemplate.dll-Help.xml')
18-
PrivateData = @{
19-
PSData = @{
20-
Tags = @('Foo')
21-
# LicenseUri = ''
22-
# ProjectUri = ''
23-
# IconUri = ''
24-
# ReleaseNotes = ''
25-
}
26-
}
27-
}
1+
# see https://docs.microsoft.com/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest
2+
# and https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-modulemanifest
3+
@{
4+
RootModule = 'PSModuleTemplate.dll'
5+
ModuleVersion = '1.0.0'
6+
CompatiblePSEditions = @('Core','Desktop')
7+
GUID = 'f5c914f0-8410-48a6-8321-6fe8b4e80cf3'
8+
Author = 'AuthorName'
9+
CompanyName = 'Unknown'
10+
Copyright = '(c) AuthorName. All rights reserved.'
11+
Description = 'A description of this module template.'
12+
PowerShellVersion = '5.1'
13+
FunctionsToExport = @()
14+
CmdletsToExport = @('Get-Foo')
15+
VariablesToExport = @()
16+
AliasesToExport = @()
17+
FileList = @('PSModuleTemplate.dll','PSModuleTemplate.dll-Help.xml')
18+
PrivateData = @{
19+
PSData = @{
20+
Tags = @('Foo')
21+
# LicenseUri = ''
22+
# ProjectUri = ''
23+
# IconUri = ''
24+
# ReleaseNotes = ''
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)