Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = '.\Capa.PowerShell.Module.PowerPack.Reg.psm1'

# Version number of this module.
ModuleVersion = '1.15.0'
ModuleVersion = '1.14.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -70,10 +70,10 @@ ProcessorArchitecture = 'None'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Reg_DeleteVariable', 'Reg_CreateKey', 'Reg_DeleteTree', 'Reg_EnumKey',
'Reg_ExistKey', 'Reg_ExistVariable', 'Reg_GetString', 'Reg_SetDword',
'Reg_SetExpandString', 'Reg_SetInteger', 'Reg_SetString',
'Set-PpRegistryValue', 'Reg_GetExpandString', 'Reg_GetInteger',
FunctionsToExport = 'Reg_DeleteVariable', 'Reg_CreateKey', 'Reg_DeleteTree', 'Reg_EnumKey',
'Reg_ExistKey', 'Reg_ExistVariable', 'Reg_GetString', 'Reg_SetDword',
'Reg_SetExpandString', 'Reg_SetInteger', 'Reg_SetString',
'Set-PpRegistryValue', 'Reg_GetExpandString', 'Reg_GetInteger',
'Reg_GetMultiString', 'Reg_SetQword'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
Expand Down
35 changes: 19 additions & 16 deletions Publish.ps1
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
Import-Module Microsoft.PowerShell.PSResourceGet

$ModulesPath = Join-Path $PSScriptRoot 'Modules'
$Modules = Get-ChildItem -Path $ModulesPath -Directory | Sort-Object { $_.Name.Length } -Descending

$VersionPath = Join-Path $PSScriptRoot 'version.txt'
$Version = (Get-Content -Path $VersionPath).Trim()
if ($Version -like '*-*') {
$FullVersion = $Version
$Version = $FullVersion.Split('-')[0]
$PrereleaseVersion = ($FullVersion -split '-', 2)[1]
$PrereleaseVersion = $PrereleaseVersion.Replace('.', '')
$Version = "$Version-$PrereleaseVersion"
$FullVersion = $Version
$Version = $FullVersion.Split('-')[0]
$PrereleaseVersion = ($FullVersion -split '-', 2)[1]
$PrereleaseVersion = $PrereleaseVersion.Replace('.', '')
$Version = "$Version-$PrereleaseVersion"
}
Write-Host "Publishing version $Version"

foreach ($Module in $Modules) {
Write-Host "Publishing module $($Module.Name)"
$ModulePath = Join-Path $ModulesPath $Module.Name 'Prod'
$PsdPath = Join-Path $ModulePath "$($Module.Name).psd1"

if (Find-Module -Name $Module.Name -RequiredVersion $Version -ErrorAction SilentlyContinue -AllowPrerelease) {
Write-Host "Module $($Module.Name) version $Version already published. Skipping" -ForegroundColor Green
continue
}

try {
Publish-PSResource -Path $ModulePath -ApiKey $env:APIKEY -SkipDependenciesCheck -SkipModuleManifestValidate
Write-Host "Publishing module $($Module.Name)"
$ModulePath = Join-Path $ModulesPath $Module.Name 'Prod'
$PsdPath = Join-Path $ModulePath "$($Module.Name).psd1"

$Exist = Find-PSResource -Name $Module.Name -Type Module -Version $Version -Repository 'PSGallery' -Prerelease -ErrorAction SilentlyContinue
if ($Exist) {
Write-Host "Module $($Module.Name) version $Version already published. Skipping" -ForegroundColor Green
continue
}

try {
Publish-PSResource -Path $ModulePath -ApiKey $env:APIKEY -SkipDependenciesCheck -SkipModuleManifestValidate -Repository 'PSGallery'
} catch {
Write-Host "Failed to publish module $($Module.Name)" -ForegroundColor Red
Write-Host $_.Exception.Message
Expand Down
Loading