File tree Expand file tree Collapse file tree 1 file changed +0
-42
lines changed
Expand file tree Collapse file tree 1 file changed +0
-42
lines changed Original file line number Diff line number Diff line change 1- param (
2- [string ]$ModulePath = (Resolve-Path ' ..' ),
3- [string ]$GalleryApiKey
4- )
5-
6- if (-not $GalleryApiKey ) {
7- $GalleryApiKey = Read-Host - AsSecureString " Enter PSGallery API key"
8- }
9-
10- Write-Host " [*] Testing module manifest..."
11- $manifest = Join-Path $ModulePath ' OffsetInspect.psd1'
12- Test-ModuleManifest - Path $manifest | Out-Null
13-
14- Write-Host " [*] Importing module for sanity check..."
15- Import-Module $manifest - Force
16-
17- Write-Host " [*] Running Pester tests..."
18- Invoke-Pester - Path (Join-Path $ModulePath ' tests' ) - Output Summary - EnableExit
19-
20- Write-Host " [*] Locating code-signing certificate..."
21- $cert = Get-ChildItem Cert:\CurrentUser\My - CodeSigningCert | Select-Object - First 1
22- if (-not $cert ) {
23- throw " No code-signing certificate found in Cert:\CurrentUser\My. Create or import one first."
24- }
25-
26- $filesToSign = @ (
27- ' OffsetInspect.psm1' ,
28- ' OffsetInspect.ps1'
29- ) | ForEach-Object { Join-Path $ModulePath $_ }
30-
31- foreach ($file in $filesToSign ) {
32- Write-Host " [*] Signing $file "
33- Set-AuthenticodeSignature - FilePath $file - Certificate $cert | Out-String | Write-Host
34- }
35-
36- Write-Host " [*] Publishing OffsetInspect to PSGallery..."
37- Publish-Module - Path $ModulePath `
38- - Repository PSGallery `
39- - NuGetApiKey $GalleryApiKey `
40- - Verbose
41-
42- Write-Host " [+] Done."
You can’t perform that action at this time.
0 commit comments