Skip to content

Commit

Permalink
Merge pull request #1 from nyanhp/feature/shinynewbuild
Browse files Browse the repository at this point in the history
Feature/shinynewbuild
  • Loading branch information
nyanhp authored Mar 19, 2024
2 parents f3c100c + 5fa1411 commit 902cae3
Show file tree
Hide file tree
Showing 235 changed files with 3,767 additions and 2,838 deletions.
5 changes: 5 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are supported funding model platforms

github:
- raandree
- nyanhp
56 changes: 56 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!--
Please be aware that we are only two people and can only help you if you help us.
Please fill out the entire issue template and do not delete sections. We really
do need that much info if you encounter an issue.
-->

<!-- Required -->
## Description

<!--
Please describe your issue in as much detail as possible for us to understand it. Please
create **one GitHub issue for each problem you experience**. Otherwise it is hard to track
the progress.
Even though we develop AutomatedLab.Common, we are not clairvoyant and need as many details as
possible to properly troubleshoot your issue. Thanks!
-->

<!-- Required -->
## Expected behavior

<!--
Please describe the expected behavior unless it is clear enough from the description
-->

<!-- Required -->
## Actual behavior

<!--
To make troubleshooting easier (unless the issue is easy to reproduce), the verbose output
of Install-Lab -Verbose will also be helpful in a code block.
-->

```output
Paste exceptions or verbose output in an output block.
```

<!-- Required -->
## Steps to reproduce

```powershell
# Please add all PowerShell Code necessary to reproduce your issue here.
#
```

<!-- Required -->
## Environment details

PowerShell Version <!-- Required -->
```output
Please paste the output of $PSVersionTable in this output field
```

AutomatedLab.Common <!-- Required -->
```output
Please paste the output of Get-Module AutomatedLab.Common -List | Select Name,Version in this output field
```
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!---
1. Please ensure that your PR points to our develop branch. If not, please retarget the branch in the upper left corner.
2. Please ensure that the develop branch of your fork is up to date!
a. git checkout develop
b. git remote add upstream https://github.com/automatedlab.common/automatedlab.common.git
c. git pull --rebase upstream develop
d. Work on any merge conflicts and follow the on-screen instructions of the git client
e. git push [--force, overwriting any changes you did to develop that were not part of our branch]
f. git checkout <YOURBRANCH>
g. git pull --rebase origin develop
h. Work on any merge conflicts and git push again
i. Open PR
3. Please provide a meaningful title for the PR. If you fix an issue, please reference it with (Fixes #nnn)
-->
## Description

Please describe your changes in detail, unless the title is already descriptive enough.

- [ ] - I have tested my changes.
- [ ] - I have updated CHANGELOG.md and added my change to the Unreleased section
- [ ] - The PR has a meaningful title.
- [ ] - I updated my fork/branch and have integrated all changes from AutomatedLab.common/develop before creating the PR.

## Type of change
<!--- Check all that apply. -->

- [ ] Bug fix
- [ ] New functionality
- [ ] Breaking change
- [ ] Documentation

## How was the change tested?
<!--
Please describe what you did to test your change, if applicable.
We are aware that there are currently no unit and integration tests, so we need
your help.
By letting us know how you tested, we can better judge what we need to test in
addition to that.
-->
41 changes: 41 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Configuration for probot-stale - https://github.com/probot/stale

limitPerRun: 30

pulls:
daysUntilStale: 14
daysUntilClose: false
exemptProjects: true
exemptMilestones: true
staleLabel: Abandoned
exemptLabels:
- Needs Review
- On hold

markComment: >
Labeling this pull request (PR) as abandoned since it has gone 14 days or more
since the last update. An abandoned PR can be continued by another contributor.
The abandoned label will be removed if work on this PR is taken up again.
issues:
daysUntilStale: 30
daysUntilClose: 40
exemptProjects: true
exemptMilestones: true
staleLabel: Stale
exemptLabels:
- Bug
- Enhancement
- Documentation
- On hold

markComment: >
This issue has been automatically marked as stale because
it has not had activity from the community in the last 30 days. It will be
closed if no further activity occurs within 10 days. If the issue is labelled
with any of the work labels (e.g bug, enhancement, documentation, or tests)
then the issue will not auto-close.
closeComment: >
This issue has been automatically closed because it is has not had activity
from the community in the last 40 days.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:
branches:
- master
- develop

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Install Prerequisites
run: .\build\vsts-prerequisites.ps1
shell: powershell
- name: Build
run: .\build\vsts-build.ps1 -SkipPublish -LocalRepo
shell: powershell
- name: Validate
run: .\build\vsts-validate.ps1
shell: powershell
- name: Publish
run: .\build\vsts-build.ps1 -ApiKey $env:APIKEY -Preview:$${{ github.ref == 'develop' }}
shell: powershell
env:
APIKEY: ${{ secrets.NUGETAPIKEY }}
18 changes: 18 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [pull_request]

jobs:
validate:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Install Prerequisites
run: .\build\vsts-prerequisites.ps1
shell: powershell
- name: Build
run: .\build\vsts-build.ps1 -SkipPublish -LocalRepo
shell: powershell
- name: Validate
run: .\build\vsts-validate.ps1
shell: powershell
23 changes: 13 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
publish
TestResults

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

Expand All @@ -14,16 +17,16 @@ about_AutomatedLab.Common.help.txt
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/
Library/[Dd]ebug/
Library/[Dd]ebugPublic/
Library/[Rr]elease/
Library/[Rr]eleases/
Library/[Xx]64/
Library/[Xx]86/
Library/[Bb]uild/
Library/bld/
Library/[Bb]in/
Library/[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
35 changes: 20 additions & 15 deletions AutomatedLab.Common/AutomatedLab.Common.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@{
@{
RootModule = 'AutomatedLab.Common.psm1'

ModuleVersion = '2.1.0'
ModuleVersion = '2.4.0'

GUID = '554685d3-5c61-4080-afd6-1dd3d4d7a261'

Author = 'Raimund Andree, Per Pedersen, Jan-Hendrik Peters'
Expand All @@ -18,38 +19,42 @@

CLRVersion = '4.0'

CompatiblePSEditions = @('Desktop','Core')
CompatiblePSEditions = @('Desktop', 'Core')

# 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 = @(
'Add-AccountPrivilege',
'Add-CATemplateStandardPermission',
'Add-Certificate2',
'Add-FunctionToPSSession',
'Add-StringIncrement',
'Add-VariableToPSSession',
'Add-TfsAgentUserCapability',
'ConvertTo-BinaryIP',
'ConvertTo-DecimalIP',
'ConvertTo-DottedDecimalIP',
'Add-VariableToPSSession',
'ConvertTo-BinaryIp',
'ConvertTo-DecimalIp',
'ConvertTo-DottedDecimalIp',
'ConvertTo-Mask',
'ConvertTo-MaskLength',
'Enable-AutoEnrollment',
'Find-CertificateAuthority',
'Get-BroadcastAddress',
'Get-CATemplate',
'Get-CaTemplate',
'Get-Certificate2',
'Get-ConsoleText',
'Get-DotNetFrameworkVersion',
'Get-DscConfigurationImportedResource',
'Get-FullMesh',
'Get-ModuleDependency',
'Get-NetworkAddress',
'Get-NetworkRange',
'Get-NetworkSummary',
'Get-NextOid',
'Get-ModuleDependency',
'Get-PerformanceCounterID',
'Get-PerformanceCounterLocalName',
'Get-PerformanceDataCollectorSet',
'Get-PublicIpAddress',
'Get-RequiredModulesFromMOF',
'Get-RunspacePool',
'Get-StringSection',
'Get-TfsAccessTokenString',
Expand All @@ -69,7 +74,7 @@
'Get-Type',
'Install-SoftwarePackage',
'Invoke-Ternary',
'New-CATemplate',
'New-CaTemplate',
'New-PerformanceDataCollectorSet',
'New-RunspacePool',
'New-TfsAgentQueue',
Expand All @@ -84,31 +89,31 @@
'Remove-PerformanceDataCollectorSet',
'Remove-RunspacePool',
'Remove-TfsAgentUserCapability',
'Request-Certificate',
'Remove-TfsFeed',
'Send-ModuleToPSSession',
'Request-Certificate',
'Send-ModuleToPsSession',
'Set-TfsAgentUserCapability',
'Set-TfsProject',
'Set-TfsFeedPermission',
'Set-TfsProject',
'Split-Array',
'Start-PerformanceDataCollectorSet',
'Start-RunspaceJob',
'Stop-PerformanceDataCollectorSet',
'Sync-Parameter',
'Test-CATemplate',
'Test-CaTemplate',
'Test-HashtableKeys',
'Test-IsAdministrator',
'Test-Port',
'Wait-RunspaceJob'
)

RequiredModules = @('newtonsoft.json', 'PSFileTransfer')
RequiredModules = @('PSFileTransfer')

CmdletsToExport = @()

VariablesToExport = @()

AliasesToExport = '??'
AliasesToExport = '??', 'Set-TfsFeedPermissions'

PrivateData = @{

Expand Down
49 changes: 7 additions & 42 deletions AutomatedLab.Common/AutomatedLab.Common.psm1
Original file line number Diff line number Diff line change
@@ -1,46 +1,11 @@
# Get public and private function definition files.
$modulebase = $PSScriptRoot
$importFolders = Get-ChildItem $modulebase -File -Recurse -ErrorAction SilentlyContinue | Group-Object { $_.Directory.Name } -AsHashTable -AsString

# Types first
$typeExists = try { [AutomatedLab.Common.Win32Exception] }catch { }
if (-not $typeExists)
{
try
{
if ($PSEdition -eq 'Core')
{
Add-Type -Path $modulebase\lib\core\AutomatedLab.Common.dll -ErrorAction Stop
}
else
{
Add-Type -Path $modulebase\lib\full\AutomatedLab.Common.dll -ErrorAction Stop
}
}
catch
{
Write-Warning -Message "Unable to add AutomatedLab.Common.dll - GPO and PKI functionality might be impaired.`r`nException was: $($_.Exception.Message), $($_.Exception.LoaderExceptions)"
}
}

try
{
[ServerCertificateValidationCallback]::Ignore()
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}
catch { }

# Dot source the files
foreach ($import in @($importFolders.Public + $importFolders.Private))
{
if ($null -eq $import) { continue }
Try
{
. $import.FullName
}
Catch
{
Write-Error -Message "Failed to import function $($import.FullName): $_"
}
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}

Export-ModuleMember -Function $importFolders.Public.Basename
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/scripts" -Filter *.ps1 -Recurse) {
. $file.FullName
}
Loading

0 comments on commit 902cae3

Please sign in to comment.