Skip to content

Commit 3063fde

Browse files
push initial code
1 parent 054ae06 commit 3063fde

File tree

8 files changed

+150
-0
lines changed

8 files changed

+150
-0
lines changed

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
2+
* text eol=autocrlf
3+
4+
*.mof text eol=crlf
5+
*.sh text eol=lf
6+
*.svg eol=lf
7+
8+
# Ensure any exe files are treated as binary
9+
*.exe binary
10+
*.jpg binary
11+
*.xl* binary
12+
*.pfx binary
13+
*.png binary
14+
*.dll binary
15+
*.so binary

.github/workflows/Publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish [PowerShellGallery]
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
BuildModule:
11+
name: Build Module
12+
runs-on: ubuntu-latest
13+
env:
14+
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v4
18+
19+
- name: Build Module
20+
uses: PSModule/Build-Module@main
21+
with:
22+
Verbose: true
23+
24+
- name: Test Module
25+
uses: PSModule/Test-Module@main
26+
with:
27+
Verbose: true
28+
29+
- name: Release Module
30+
uses: PSModule/Release-Module@main
31+
with:
32+
APIKey: ${{ secrets.APIKEY }}
33+
Verbose: true

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# VS Code files for those working on multiple tools
2+
.vscode/*
3+
!.vscode/settings.json
4+
!.vscode/tasks.json
5+
!.vscode/launch.json
6+
!.vscode/extensions.json
7+
*.code-workspace
8+
9+
# Local History for Visual Studio Code
10+
.history/*
11+
12+
# The Powershell build outputs folder
13+
outputs/*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Marius Storhaug
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

icon/PowerShell_Core_6.0_icon.png

9.25 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@{
2+
# Author of this module
3+
Author = 'Marius Storhaug'
4+
5+
# Description of the functionality provided by this module
6+
Description = 'A PowerShell module for managing the PowerShell Gallery.'
7+
8+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
9+
PrivateData = @{
10+
11+
PSData = @{
12+
13+
# Tags applied to this module. These help with module discovery in online galleries.
14+
Tags = 'PowerShellGallery', 'Environment', 'PowerShell', 'Module'
15+
16+
# A URL to the license for this module.
17+
LicenseUri = 'https://github.com/PSModule/PowerShellGallery/blob/main/LICENSE'
18+
19+
# A URL to the main website for this project.
20+
ProjectUri = 'https://github.com/PSModule/PowerShellGallery'
21+
22+
# A URL to an icon representing this module.
23+
IconUri = 'https://raw.githubusercontent.com/PSModule/PowerShellGallery/main/icon/PowerShell_Core_6.0_icon.png'
24+
25+
} # End of PSData hashtable
26+
27+
} # End of PrivateData hashtable
28+
29+
# HelpInfo URI of this module
30+
HelpInfoURI = 'https://PSModule.github.io/PowerShellGallery'
31+
32+
}
33+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[Cmdletbinding()]
2+
param()
3+
4+
Write-Verbose 'Importing subcomponents'
5+
$Folders = 'classes', 'private', 'public'
6+
# Import everything in these folders
7+
Foreach ($Folder in $Folders) {
8+
$Root = Join-Path -Path $PSScriptRoot -ChildPath $Folder
9+
Write-Verbose "Processing folder: $Root"
10+
if (Test-Path -Path $Root) {
11+
Write-Verbose "Getting all files in $Root"
12+
$Files = $null
13+
$Files = Get-ChildItem -Path $Root -Include '*.ps1', '*.psm1' -Recurse
14+
# dot source each file
15+
foreach ($File in $Files) {
16+
Write-Verbose "Importing $($File)"
17+
Import-Module $File
18+
Write-Verbose "Importing $($File): Done"
19+
}
20+
}
21+
}
22+
23+
$Param = @{
24+
Function = (Get-ChildItem -Path "$PSScriptRoot\public" -Include '*.ps1' -Recurse).BaseName
25+
Variable = '*'
26+
Cmdlet = '*'
27+
Alias = '*'
28+
}
29+
30+
Write-Verbose 'Exporting module members'
31+
32+
Export-ModuleMember @Param -Verbose
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function Get-PSGalleryAPI {
2+
$response = Invoke-RestMethod -Method Get -Uri https://www.powershellgallery.com/api/v2/ -ContentType 'application/json'
3+
}

0 commit comments

Comments
 (0)