Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Fix#240/add build step to construct psm1 #242

Merged
merged 20 commits into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
155e6b5
Updated build script to merge public and private .ps1 files into plac…
Benny1007 Mar 10, 2018
e9c72ef
refactor for functions subfolders and psm file construction
Benny1007 Mar 10, 2018
cbf6df2
reverted psm1 file to commit 88d3d9e, refactored psm1 file to be dot …
Benny1007 Mar 21, 2018
fb0e189
Removed update-modulemanifest and replace with manual version
Benny1007 Mar 24, 2018
b8cb0d5
update build artifact archiving
Benny1007 Mar 24, 2018
6836296
Change archive to write to tmp folder first
Mar 24, 2018
3f2855f
fix non-windows artifact archiving
Mar 24, 2018
b7b1c9b
remove appveyor commented code
Mar 24, 2018
bcda230
Fix non-windows artifact archiving
Benny1007 Mar 25, 2018
1692e26
Merge branch 'fix#240/Add-build-step-to-construct-psm1' of https://gi…
Mar 25, 2018
e035daa
fix import of localized data for merged module by moving import to ps…
Mar 27, 2018
08b091a
make use of join-path for multi os pathing
Mar 27, 2018
853d71f
moved install of new module outside of tests, into function that inst…
Mar 27, 2018
66ddc64
updated build scripts appveyor and travis
Mar 27, 2018
eff426c
Moved install of packagemanagement into function and called from inst…
Apr 3, 2018
a5f01d2
removed commented code
Apr 3, 2018
605a0f4
removed whitespace from test file
Apr 3, 2018
f7fec2b
add switch to Invoke-PowerShellGetTest in travis.sh
Apr 3, 2018
59a6226
fix file encoding of psm1 file
Apr 3, 2018
14abbc7
remove bootstrap of nuget from test function to install function, fix…
Apr 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor for functions subfolders and psm file construction
  • Loading branch information
Benny1007 committed Mar 24, 2018
commit e9c72ef4918abfb8c166170b7f9a275b228c6b97
57 changes: 19 additions & 38 deletions PowerShellGet/PSModule.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -833,22 +833,28 @@ $(if($script:IsSafeX509ChainHandleAvailable)

#endregion

#region private functions imported via build script

#region Load of module functions after split from main .psm1 file issue Fix#37
#buildScriptPrivateFunctionsGoHere

$PublicFunctions = @( Get-ChildItem -Path $PSScriptRoot\public\*.ps1 -ErrorAction SilentlyContinue )
$PrivateFunctions = @( Get-ChildItem -Path $PSScriptRoot\private\*.ps1 -ErrorAction SilentlyContinue )
#endregion

# Load the separate function files from the private and public folders.
$AllFunctions = $PublicFunctions + $PrivateFunctions
foreach($function in $AllFunctions) {
try {
. $function.Fullname
}
catch {
Write-Error -Message "Failed to import function $($function.fullname): $_"
}
}
#region public functions imported via build script

#buildScriptPublicFunctionsGoHere

#endregion

#region module exports
Set-Alias -Name fimo -Value Find-Module
Set-Alias -Name inmo -Value Install-Module
Set-Alias -Name upmo -Value Update-Module
Set-Alias -Name pumo -Value Publish-Module
Set-Alias -Name uimo -Value Uninstall-Module

Export-ModuleMember -Alias fimo, inmo, upmo, pumo, uimo

#buildScriptExportFunctionsGoHere

#endregion

Expand Down Expand Up @@ -879,28 +885,3 @@ if(-not (Microsoft.PowerShell.Management\Test-Path -Path $script:MyDocumentsInst
-Confirm:$false `
-WhatIf:$false
}

#region private functions imported via build script

#buildScriptPrivateFunctionsGoHere

#endregion

#region public functions imported via build script

#buildScriptPublicFunctionsGoHere

#endregion

#region module exports
Set-Alias -Name fimo -Value Find-Module
Set-Alias -Name inmo -Value Install-Module
Set-Alias -Name upmo -Value Update-Module
Set-Alias -Name pumo -Value Publish-Module
Set-Alias -Name uimo -Value Uninstall-Module

Export-ModuleMember -Alias fimo, inmo, upmo, pumo, uimo

#buildScriptExportFunctionsGoHere

#endregion
28 changes: 2 additions & 26 deletions PowerShellGet/PowerShellGet.psd1
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
@{
RootModule = 'PSModule.psm1'
ModuleVersion = '1.6.1'
ModuleVersion = '1.6.3'
GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
Description = 'PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.'
PowerShellVersion = '3.0'
FormatsToProcess = 'PSGet.Format.ps1xml'
FunctionsToExport = @('Install-Module',
'Find-Module',
'Save-Module',
'Update-Module',
'Publish-Module',
'Get-InstalledModule',
'Uninstall-Module',
'Find-Command',
'Find-DscResource',
'Find-RoleCapability',
'Install-Script',
'Find-Script',
'Save-Script',
'Update-Script',
'Publish-Script',
'Get-InstalledScript',
'Uninstall-Script',
'Test-ScriptFileInfo',
'New-ScriptFileInfo',
'Update-ScriptFileInfo',
'Get-PSRepository',
'Set-PSRepository',
'Register-PSRepository',
'Unregister-PSRepository',
'Update-ModuleManifest')
FunctionsToExport = @()
VariablesToExport = "*"
AliasesToExport = @('inmo','fimo','upmo','pumo')
FileList = @('PSModule.psm1',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Find-Command
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=733636')]
[outputtype('PSCustomObject[]')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Find-DscResource
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=517196')]
[outputtype('PSCustomObject[]')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Find-Module
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkID=398574')]
[outputtype("PSCustomObject[]")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Find-RoleCapability
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=718029')]
[outputtype('PSCustomObject[]')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Find-Script
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkId=619785')]
[outputtype("PSCustomObject[]")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Get-InstalledModule
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkId=526863')]
Param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Get-InstalledScript
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkId=619790')]
Param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Get-PSRepository
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkID=517127')]
Param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Install-Module
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
HelpUri='https://go.microsoft.com/fwlink/?LinkID=398573',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Install-Script
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619784',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function New-ScriptFileInfo
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(PositionalBinding=$false,
SupportsShouldProcess=$true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Publish-Module
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(SupportsShouldProcess=$true,
PositionalBinding=$false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Publish-Script
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(SupportsShouldProcess=$true,
PositionalBinding=$false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Register-PSRepository
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
HelpUri='https://go.microsoft.com/fwlink/?LinkID=517129')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Save-Module
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameAndPathParameterSet',
HelpUri='https://go.microsoft.com/fwlink/?LinkId=531351',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Save-Script
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameAndPathParameterSet',
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619786',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Set-PSRepository
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(PositionalBinding=$false,
HelpUri='https://go.microsoft.com/fwlink/?LinkID=517128')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Test-ScriptFileInfo
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(PositionalBinding=$false,
DefaultParameterSetName='PathParameterSet',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Uninstall-Module
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
SupportsShouldProcess=$true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Uninstall-Script
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(DefaultParameterSetName='NameParameterSet',
SupportsShouldProcess=$true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Unregister-PSRepository
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(HelpUri='https://go.microsoft.com/fwlink/?LinkID=517130')]
Param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Update-Module
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(SupportsShouldProcess=$true,
HelpUri='https://go.microsoft.com/fwlink/?LinkID=398576')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Update-ModuleManifest
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(SupportsShouldProcess=$true,
PositionalBinding=$false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Update-Script
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(SupportsShouldProcess=$true,
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619787')]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Update-ScriptFileInfo
{
<#
.ExternalHelp ..\PSModule-help.xml
.ExternalHelp PSModule-help.xml
#>
[CmdletBinding(PositionalBinding=$false,
DefaultParameterSetName='PathParameterSet',
Expand Down
Loading