Skip to content
Open
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
21 changes: 14 additions & 7 deletions Invoke-Locksmith.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3136,8 +3136,8 @@ function New-OutputPath {
Creates output directories for each forest.

.DESCRIPTION
This script creates one output directory per forest specified in the $Targets variable.
The output directories are created under the $OutputPath directory.
Creates one output directory per forest specified in the Targets parameter.
The output directories are created under the OutputPath directory.

.PARAMETER Targets
Specifies the forests for which output directories need to be created.
Expand All @@ -3152,11 +3152,18 @@ function New-OutputPath {
#>

[CmdletBinding(SupportsShouldProcess)]
param ()
# Create one output directory per forest
foreach ( $forest in $Targets ) {
$ForestPath = $OutputPath + "`\" + $forest
New-Item -Path $ForestPath -ItemType Directory -Force | Out-Null
param (
[Parameter(Mandatory)]
[array]$Targets,

[Parameter(Mandatory)]
[string]$OutputPath
)
foreach ($forest in $Targets) {
$ForestPath = Join-Path -Path $OutputPath -ChildPath $forest
if ($PSCmdlet.ShouldProcess($ForestPath, 'Create directory')) {
New-Item -Path $ForestPath -ItemType Directory -Force | Out-Null
}
}
}

Expand Down
21 changes: 14 additions & 7 deletions Private/New-OutputPath.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Creates output directories for each forest.

.DESCRIPTION
This script creates one output directory per forest specified in the $Targets variable.
The output directories are created under the $OutputPath directory.
Creates one output directory per forest specified in the Targets parameter.
The output directories are created under the OutputPath directory.

.PARAMETER Targets
Specifies the forests for which output directories need to be created.
Expand All @@ -20,10 +20,17 @@
#>

[CmdletBinding(SupportsShouldProcess)]
param ()
# Create one output directory per forest
foreach ( $forest in $Targets ) {
$ForestPath = $OutputPath + "`\" + $forest
New-Item -Path $ForestPath -ItemType Directory -Force | Out-Null
param (
[Parameter(Mandatory)]
[array]$Targets,

[Parameter(Mandatory)]
[string]$OutputPath
)
foreach ($forest in $Targets) {
$ForestPath = Join-Path -Path $OutputPath -ChildPath $forest
if ($PSCmdlet.ShouldProcess($ForestPath, 'Create directory')) {
New-Item -Path $ForestPath -ItemType Directory -Force | Out-Null
}
}
}
Loading