mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Propagates verbose preference to the common module
Sets the verbose preference within the `FFU.Common` module to match the preference of the calling script. This ensures that when the script is run with the `-Verbose` switch, verbose output from the module is also logged to the console.
This commit is contained in:
@@ -418,6 +418,12 @@ if (Get-Module -Name 'FFU.Common.Drivers' -ErrorAction SilentlyContinue) {
|
||||
# Import the required modules
|
||||
Import-Module "$PSScriptRoot\FFU.Common" -Force
|
||||
|
||||
# Set the module's verbose preference to match the script's - allows logging verbose output to console.
|
||||
$moduleInfo = Get-Module -Name 'FFU.Common'
|
||||
if ($moduleInfo) {
|
||||
& $moduleInfo { $script:VerbosePreference = $args[0] } $VerbosePreference
|
||||
}
|
||||
|
||||
# If a config file is specified and it exists, load it
|
||||
if ($ConfigFile -and (Test-Path -Path $ConfigFile)) {
|
||||
$configData = Get-Content $ConfigFile -Raw | ConvertFrom-Json
|
||||
|
||||
Reference in New Issue
Block a user