Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PSFramework/PSFramework.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'PSFramework.psm1'

# Version number of this module.
ModuleVersion = '1.14.454'
ModuleVersion = '1.14.457'

# ID used to uniquely identify this module
GUID = '8028b914-132b-431f-baa9-94a6952f21ff'
Expand Down
6 changes: 6 additions & 0 deletions PSFramework/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 1.14.457 (2026-07-02)

- New: ConfigValidation rstimeout - Validates input as a legal setting for the Runspace Workflow Worker's timeout
- Upd: Set-PSFLoggingProvider - accepts input via config set
- Upd: Disable-PSFLoggingProvider - accepts input via config set

## 1.14.454 (2026-07-01)

- New: Type PSFramework.Utility.HumanizedTimeSpan - a human-friendly duration display alternative.
Expand Down
21 changes: 11 additions & 10 deletions PSFramework/en-us/stringsLogging.psd1
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
@{
'Add-PSFLoggingProviderRunspace.Instance.NotFound' = 'Unable to find logging provider instance {1} of provider {0}' # $ProviderName, $InstanceName
'Add-PSFLoggingProviderRunspace.Instance.NotFound' = 'Unable to find logging provider instance {1} of provider {0}' # $ProviderName, $InstanceName

'Import-PSFLoggingProvider.Import.Error' = "Error loading json data from {0}" # $effectivePath
'Import-PSFLoggingProvider.Datum.Error' = "Error processing logging provider entry" #
'Import-PSFLoggingProvider.Import.Error' = "Error loading json data from {0}" # $effectivePath
'Import-PSFLoggingProvider.Datum.Error' = "Error processing logging provider entry" #

'Install-PSFLoggingProvider.Provider.NotFound' = "Provider {0} not found!" # $Name
'Install-PSFLoggingProvider.Installation.Error' = "Failed to install provider '{0}'" # $Name
'Install-PSFLoggingProvider.Provider.NotFound' = "Provider {0} not found!" # $Name
'Install-PSFLoggingProvider.Installation.Error' = "Failed to install provider '{0}'" # $Name

'Register-PSFLoggingProvider.RegistrationEvent.Failed' = "Failed to register logging provider '{0}' - Registration event failed." # $Name
'Register-PSFLoggingProvider.Installation.Failed' = "Failed to install logging provider '{0}'" # $Name
'Register-PSFLoggingProvider.Installation.Failed' = "Failed to install logging provider '{0}'" # $Name
'Register-PSFLoggingProvider.NotInstalled.Termination' = "Failed to enable logging provider {0} on registration! It was not recognized as installed. Consider running 'Install-PSFLoggingProvider' to properly install the prerequisites." # $Name

'Register-PSFMessageColorTransform.Level.Invalid' = 'Invalid level for a message color rule: {0}! The levels "Warning" and "Error" cannot be selected as warning messages cannot be colored.' # $Level

'Set-PSFLoggingProvider.Provider.NotFound' = 'Provider {0} not found!' # $Name
'Set-PSFLoggingProvider.Provider.V1NoInstance' = 'The Provider {0} is a first generation logging provider and does not support instances!' # $Name
'Set-PSFLoggingProvider.Provider.NotInstalled' = 'Provider {0} not installed! Run "Install-PSFLoggingProvider" first' # $Name
'Set-PSFLoggingProvider.Wait.Timeout' = 'Timeout waiting for {0} > {1} to be created. Logs may not be written as expected!' # $Name, $InstanceName
'Set-PSFLoggingProvider.Error.ConfigNoName' = 'Invalid logging configuration: No provider name ("Name") specified! | {0}' # $params
'Set-PSFLoggingProvider.Provider.NotFound' = 'Provider {0} not found!' # $Name
'Set-PSFLoggingProvider.Provider.V1NoInstance' = 'The Provider {0} is a first generation logging provider and does not support instances!' # $Name
'Set-PSFLoggingProvider.Provider.NotInstalled' = 'Provider {0} not installed! Run "Install-PSFLoggingProvider" first' # $Name
'Set-PSFLoggingProvider.Wait.Timeout' = 'Timeout waiting for {0} > {1} to be created. Logs may not be written as expected!' # $Name, $InstanceName
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
Runs the $scriptblock against all computers in AD with a name that starts with "srv-db".
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectUsageOfAssignmentOperator", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Invoke-PSFCommand')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Invoke-PSFCommand')]
param (
[PSFComputer[]]
[Alias('Session')]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/configuration/Export-PSFConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
Exports all settings of the module 'MyModule' that are no longer the original default values to json.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "")]
[CmdletBinding(DefaultParameterSetName = 'FullName', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Export-PSFConfig')]
[CmdletBinding(DefaultParameterSetName = 'FullName', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Export-PSFConfig')]
param (
[Parameter(ParameterSetName = "FullName", Position = 0, Mandatory = $true)]
[string]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/configuration/Get-PSFConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "")]
[OutputType([PSFramework.Configuration.Config])]
[CmdletBinding(DefaultParameterSetName = "FullName", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfig')]
[CmdletBinding(DefaultParameterSetName = "FullName", HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Get-PSFConfig')]
Param (
[Parameter(ParameterSetName = "FullName", Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[string]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/configuration/Get-PSFConfigValue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Returns the configured value for 'Default.CoffeeMilk'. If no such value is configured, it returns '0' instead.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectComparisonWithNull", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfigValue')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Get-PSFConfigValue')]
param (
[Alias('Name')]
[Parameter(Mandatory = $true, Position = 0)]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/configuration/Import-PSFConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
Imports all the module specific settings that have been persisted in any of the default file system paths.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingEmptyCatchBlock", "")]
[CmdletBinding(DefaultParameterSetName = "Path", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Import-PSFConfig')]
[CmdletBinding(DefaultParameterSetName = "Path", HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Import-PSFConfig')]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Path")]
[string[]]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/configuration/Register-PSFConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

Retrieves all configuration items of the module MyModule, then registers them in registry to enforce them for all users on the current system.
#>
[CmdletBinding(DefaultParameterSetName = "Default", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFConfig')]
[CmdletBinding(DefaultParameterSetName = "Default", HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Register-PSFConfig')]
param (
[Parameter(ParameterSetName = "Default", Position = 0, ValueFromPipeline = $true)]
[PSFramework.Configuration.Config[]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

Registers the scriptblock stored in $scriptblock as validation with the name IntPositive
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFConfigValidation')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Register-PSFConfigValidation')]
Param (
[Parameter(Mandatory = $true)]
[string]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/configuration/Reset-PSFConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

Resets the configuration item named 'MyModule.Group.Setting1'.
#>
[CmdletBinding(DefaultParameterSetName = 'Pipeline', SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Reset-PSFConfig')]
[CmdletBinding(DefaultParameterSetName = 'Pipeline', SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Reset-PSFConfig')]
param (
[Parameter(ValueFromPipeline = $true, ParameterSetName = 'Pipeline')]
[PSFramework.Configuration.Config[]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

Unregisters all configuration settings for the module MyModule.
#>
[CmdletBinding(DefaultParameterSetName = 'Pipeline', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Unregister-PSFConfig')]
[CmdletBinding(DefaultParameterSetName = 'Pipeline', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Unregister-PSFConfig')]
param (
[Parameter(ValueFromPipeline = $true, ParameterSetName = 'Pipeline')]
[PSFramework.Configuration.Config[]]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/flowcontrol/Stop-PSFFunction.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
In both cases, the error record added to $error will have the content of $foo added, the better to figure out what went wrong.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(DefaultParameterSetName = 'Message', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Stop-PSFFunction')]
[CmdletBinding(DefaultParameterSetName = 'Message', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Stop-PSFFunction')]
param (
[Parameter(Mandatory = $true, ParameterSetName = 'Message')]
[string]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
The calling function will stop if this function returns true.
#>
[OutputType([System.Boolean])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFFunctionInterrupt')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Test-PSFFunctionInterrupt')]
Param (

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

Returns whether any of the specified parameters was not bound
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFParameterBinding')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Test-PSFParameterBinding')]
Param (
[Parameter(Mandatory = $true, Position = 0)]
[string[]]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/flowcontrol/Test-PSFPowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
Will return $false unless executed on a PowerShell 6.1 console running on windows.
#>
[OutputType([System.Boolean])]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Test-PSFPowerShell')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Test-PSFPowerShell')]
param (
[Version]
$PSMinVersion,
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/import/Import-PSFCmdlet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
Original Author: Chris Dent
Link: https://www.indented.co.uk/cmdlets-without-a-dll/
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Import-PSFCmdlet')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Import-PSFCmdlet')]
param (
[Parameter(Mandatory = $true)]
[String]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- having it accept the type 'microsoft.activedirectory.management.adcomputer'
- having it use the 'DNSHostName' property if available, falling back to 'Name' if necessary
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFParameterClassMapping')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Register-PSFParameterClassMapping')]
param (
[Parameter(Mandatory = $true)]
[PSFramework.Parameter.ParameterClasses]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/import/Set-PSFTypeAlias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
Creates an alias for the type 'System.IO.Path' named 'path'
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(DefaultParameterSetName = 'Name', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Set-PSFTypeAlias')]
[CmdletBinding(DefaultParameterSetName = 'Name', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Set-PSFTypeAlias')]
Param (
[Parameter(Mandatory = $true, Position = 0, ParameterSetName = 'Name', ValueFromPipelineByPropertyName = $true)]
[string]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/license/Get-PSFLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Returns a list of all registered licenses for products that have commercial licenses and are libraries.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "")]
[CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLicense')]
[CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Get-PSFLicense')]
[OutputType([PSFramework.License.License])]
param (
[Parameter(Position = 0)]
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/license/New-PSFLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

This registers the Awesome Test Product as licensed under the common FreeBSD license.
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/New-PSFLicense')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/New-PSFLicense')]
[OutputType([PSFramework.License.License])]
param
(
Expand Down
2 changes: 1 addition & 1 deletion PSFramework/functions/license/Remove-PSFLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

Removes the license for the product "FooBar" from the license store.
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Remove-PSFLicense')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Remove-PSFLicense')]
Param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[PSFramework.License.License[]]
Expand Down
44 changes: 38 additions & 6 deletions PSFramework/functions/logging/Disable-PSFLoggingProvider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

.PARAMETER InstanceObject
A full Logging Provider Instance object, as return by Get-PSFLoggingProviderInstance

.PARAMETER Config
One or more configuration objects to disable.
Each entry must provide the provider Name and may include a specific InstanceName.
All other settings are ignored.

.PARAMETER NoFinalizeWait
Do not wait for the logging to conclude or the final events shutting down the provider instance to finish.
Expand Down Expand Up @@ -50,7 +55,13 @@
.EXAMPLE
PS C:\> Get-PSFLoggingProviderInstance | Disable-PSFLoggingProvider

Disables all active logging provider instacnes
Disables all active logging provider instances

.EXAMPLE
PS C:\> Disable-PSFLoggingProvider -Config $config.Logging

Disables all logging provider instances defined in $config.Logging
This allows convenient logging configuration from a config file - it takes the same config data Set-PSFLoggingProvider accepts.
#>
[CmdletBinding(DefaultParameterSetName = 'ByName')]
param (
Expand All @@ -70,6 +81,10 @@
[PSFramework.Logging.ProviderInstance[]]
$InstanceObject,

[Parameter(Mandatory = $true, ParameterSetName = 'ByConfig')]
[object[]]
$Config,

[switch]
$NoFinalizeWait
)
Expand All @@ -86,19 +101,36 @@
$instance.NotAfter = $limit
}

foreach ($instance in $instances) {
$instance.Drain((-not $NoFinalizeWait))
}
$null = $inInstances.Add($instance)
}

foreach ($instance in $InstanceObject) {
$instance.NotAfter = $limit
$null = $inInstances.Add($instance)
}

foreach ($entry in $Config) {
if ($null -eq $entry) { continue }
$param = $entry | ConvertTo-PSFHashtable -Include Name, InstanceName -Remap ([ordered]@{ Name = 'ProviderName'; InstanceName = 'Name' })
if (-not $param.Name) { $param.Name = 'Default' }

$instances = Get-PSFLoggingProviderInstance @param

foreach ($instance in $instances) {
$instance.NotAfter = $limit
}

$null = $inInstances.Add($instance)
}
}
end {
# Prevent duplicate draining
$drained = [System.Collections.ArrayList]@()

foreach ($instance in $inInstances) {
$instance.Drain((-not $NoFinalizeWait))
}
if ($instance -in $drained) { continue }
$instance.Drain((-not $NoFinalizeWait))
$null = $drained.Add($instance)
}
}
}
2 changes: 1 addition & 1 deletion PSFramework/functions/logging/Get-PSFLoggingProvider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

Returns the filesystem provider
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLoggingProvider')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Get-PSFLoggingProvider')]
[OutputType([PSFramework.Logging.Provider])]
Param (
[Alias('Provider', 'ProviderName')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

Returns all logging provider instances - enabled or not - of the logfile provider
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLoggingProvider')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Get-PSFLoggingProvider')]
[OutputType([PSFramework.Logging.Provider])]
param (
[string]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

Installs a logging provider named 'eventlog'
#>
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Install-PSFLoggingProvider')]
[CmdletBinding(HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Install-PSFLoggingProvider')]
param (
[Alias('Provider', 'ProviderName')]
[string]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "")]
[PSFramework.PSFCore.NoJeaCommandAttribute()]
[CmdletBinding(DefaultParameterSetName = 'Version1', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFLoggingProvider')]
[CmdletBinding(DefaultParameterSetName = 'Version1', HelpUri = 'https://psframework.org/docs/Commands/PSFramework/Register-PSFLoggingProvider')]
param (
[Parameter(Mandatory = $true)]
[string]
Expand Down
Loading