mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
Commit 2c6e8ced: Multiple changes
- Check output - Updated list generation - Started subdomain takeover check module
This commit is contained in:
41
Powershell/Modules/build.ps1
Normal file
41
Powershell/Modules/build.ps1
Normal file
@@ -0,0 +1,41 @@
|
||||
using namespace System.Management.Automation.Language
|
||||
|
||||
Build-Module -Path (Resolve-Path -Path $PSScriptRoot\*\build.psd1)
|
||||
|
||||
$rootModulePath = @{
|
||||
Path = $PSScriptRoot
|
||||
ChildPath = 'build\*\*\*.psm1'
|
||||
}
|
||||
$rootModule = Join-Path @rootModulePath | Resolve-Path
|
||||
$tokens = $errors = $null
|
||||
$ast = [Parser]::ParseFile(
|
||||
$rootModule,
|
||||
[ref]$tokens,
|
||||
[ref]$errors
|
||||
)
|
||||
$dscResourcesToExport = $ast.FindAll(
|
||||
{
|
||||
param ( $node )
|
||||
|
||||
$node -is [TypeDefinitionAst] -and
|
||||
$node.IsClass -and
|
||||
$node.Attributes.TypeName.FullName -contains 'DscResource'
|
||||
},
|
||||
$true
|
||||
).Name
|
||||
|
||||
if ($dscResourcesToExport) {
|
||||
$moduleManifestPath = @{
|
||||
Path = $pwd
|
||||
ChildPath = 'build\*\*\*.psd1'
|
||||
}
|
||||
$moduleManifest = Join-Path @moduleManifestPath |
|
||||
Get-Item |
|
||||
Where-Object { $_.BaseName -eq $_.Directory.Parent.Name }
|
||||
|
||||
$updateParams = @{
|
||||
Path = $moduleManifest
|
||||
DscResourcesToExport = $dscResourcesToExport
|
||||
}
|
||||
Update-ModuleManifest @updateParams
|
||||
}
|
||||
Reference in New Issue
Block a user