Skip to content

Commit

Permalink
Merge pull request #3 from DennisL68/feat_support_for_missing_patch_e…
Browse files Browse the repository at this point in the history
…rror

feat(0.2.0): Added "missing patches" as an error condition
  • Loading branch information
DennisL68 authored Aug 28, 2023
2 parents 1cd3a52 + be71e9c commit 00116e7
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 229 deletions.
2 changes: 1 addition & 1 deletion PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@{
'Rules' = @{
'PSAvoidUsingCmdletAliases' = @{
'allowlist' = @('foreach','select','where')
'allowlist' = @('foreach','select','where','group','compare','sort','sleep')
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A PowerShell wrapper for SharePoint Products Configuration Wizard, psconfig, cre

* Clone the repo to your local system

* Dot Source the parse script the build
* Dot Source the output script to be able to build
`. .\src\Invoke-ParseConfig.ps1`

* Run the build script
Expand Down
20 changes: 10 additions & 10 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ foreach ($Module in $Modules) {
-ErrorAction SilentlyContinue

if (-not $ModuleExist) {
Install-Module $Module.Name -RequiredVersion $Mdoule.Version -AllowPrerelease -Force -Scope CurrentUser
Install-Module $Module.Name -RequiredVersion $Module.Version -AllowPrerelease -Force -Scope CurrentUser
}
}

Expand All @@ -31,16 +31,16 @@ if (-not (Get-Item function:Invoke-ParseError)) {
throw 'Missing functions'
}

<#
$Commands = Get-ChildItem "$PSScriptRoot\src\*.json" | foreach {
<#
$Commands = Get-ChildItem "$PSScriptRoot\src\*.json" | foreach {
$Definition = Get-Content $_.FullName | ConvertFrom-Json | Select -ExpandProperty Commands
$Command = New-CrescendoCommand -Verb $Definition.Verb -Noun $Definition.Noun -OriginalName $Definition.OriginalName
$Command.OriginalCommandElements = $Definition.OriginalCommandElements
$Command.Platform = "Windows"
if ($Definition.Parameters) {
$Command.Parameters = $Definition.Parameters | ForEach-Object {
$Parameter = New-ParameterInfo -Name $_.Name -OriginalName $_.OriginalName
$Parameter = New-ParameterInfo -Name $_.Name -OriginalName $_.OriginalName
$Parameter.OriginalName = $_.OriginalName
$Parameter.OriginalPosition = $_.OriginalPosition
$Parameter.ParameterType = $_.ParameterType
Expand All @@ -50,7 +50,7 @@ $Commands = Get-ChildItem "$PSScriptRoot\src\*.json" | foreach {
if ($Definition.OutputHandlers) {
$Command.OutputHandlers = $Definition.OutputHandlers | ForEach-Object {
$Handler = New-OutputHandler
$Handler = New-OutputHandler
$Handler.ParameterSetName = $_.ParameterSetName
$Handler.Handler = $_.Handler
$Handler.HandlerType = $_.HandlerType
Expand All @@ -59,21 +59,21 @@ $Commands = Get-ChildItem "$PSScriptRoot\src\*.json" | foreach {
}
}
$Command
$Command
}
@{
'$schema' = 'https://aka.ms/PowerShell/Crescendo/Schemas/2022-06'
Commands = $Commands
} | ConvertTo-Json -Depth 5 | Out-File "$obj\Commands.json"
Export-CrescendoModule -ConfigurationFile (Get-ChildItem "$obj\*.json") -ModuleName (Join-Path $Output 'PSConfig.Crescendo') -Force
Export-CrescendoModule -ConfigurationFile (Get-ChildItem "$obj\*.json") -ModuleName (Join-Path $Output 'PSConfig.Crescendo') -Force
#>

Export-CrescendoModule `
-ConfigurationFile $PSScriptRoot\src\PSConfig.Crescendo.json `
-ModuleName (Join-Path $Output 'PSConfig.Crescendo') `
-Force
-Force

$ManifestInfo = @{
ModuleVersion = $Version
Expand All @@ -87,10 +87,10 @@ Export-CrescendoModule -ConfigurationFile (Get-ChildItem "$obj\*.json") -ModuleN
#A URL to an icon representing this module.
#IconUri = ''
#ReleaseNotes of this module
#ReleaseNotes = ''
#ReleaseNotes = ''
}

Update-ModuleManifest -Path (Join-Path $Output 'PSConfig.Crescendo.psd1') @ManifestInfo
Update-ModuleManifest -Path (Join-Path $Output 'PSConfig.Crescendo.psd1') @ManifestInfo

Invoke-ScriptAnalyzer "$PSScriptRoot\output\PSConfig.Crescendo.psd1" -ExcludeRule PSAvoidTrailingWhitespace

Expand Down
4 changes: 2 additions & 2 deletions publish.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Rename-Item "$PSScriptRoot\output" -NewName "PSConfig.Crescendo"
Publish-Module -Path "$PSScriptRoot\PSConfig.Crescendo" -NuGetApiKey $Env:NUGETAPIKEY
Rename-Item "$PSScriptRoot\output" -NewName "PSConfig.Crescendo"
Publish-Module -Path "$PSScriptRoot\PSConfig.Crescendo" -NuGetApiKey $Env:NUGETAPIKEY
6 changes: 3 additions & 3 deletions src/Invoke-ParsePSConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
[Parameter()]
[string[]]$InputString
)
<#
<#
$logs = $InputString -like '*located*' | # get all lines containing a log file location
foreach {# and extract the log file path
$_ -replace "`n",'' -replace "`r",'' -split 'located' | select -index 1
} |
} |
foreach {
$_ -split ' ' | select -Index 2
}
#>
$InputString -match 'error|exception|throw|invalid|fail|diagnostic' |
$InputString -match 'error|exception|throw|invalid|fail|diagnostic|missing' |
where {$_ -notlike '*success*'} |
foreach {
write-error -Message $_
Expand Down
Loading

0 comments on commit 00116e7

Please sign in to comment.