Skip to content

Commit

Permalink
Removed unnecessary import of SDefaultParameterVal
Browse files Browse the repository at this point in the history
When ScriptBlock Argument Completers ps1 file is already imported in a cmdlet/function then it's not necessary to import the SDefaultParameterValues.ps1 again
  • Loading branch information
HotCakeX committed Dec 9, 2023
1 parent 69f2d42 commit ec602d9
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Function Deploy-SignedWDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ Function Edit-SignedWDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
2 changes: 0 additions & 2 deletions WDACConfig/WDACConfig Module Files/Core/Edit-WDACConfig.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ Function Edit-WDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Function Invoke-WDACSimulation {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing resources such as functions by dot-sourcing so that they will run in the same scope and their variables will be usable
. "$ModuleRootPath\Resources\Resources2.ps1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Function New-DenyWDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ Function New-SupplementalWDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
2 changes: 0 additions & 2 deletions WDACConfig/WDACConfig Module Files/Core/New-WDACConfig.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ Function New-WDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ Function Remove-WDACConfig {
)

begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Update-self.psm1" -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ Function Set-CommonWDACConfig {
[parameter(Mandatory = $false, DontShow = $true)][System.DateTime]$LastUpdateCheck
)
begin {
# Importing the $PSDefaultParameterValues to the current session, prior to everything else
. "$ModuleRootPath\CoreExt\PSDefaultParameterValues.ps1"
# Importing the required sub-modules
Write-Verbose -Message 'Importing the required sub-modules'
Import-Module -FullyQualifiedName "$ModuleRootPath\Shared\Write-ColorfulText.psm1" -Force
Expand Down

0 comments on commit ec602d9

Please sign in to comment.