Variable error in ProcessModuleFile
This commit is contained in:
parent
97ad26ff91
commit
db821afe77
1 changed files with 2 additions and 1 deletions
|
@ -512,6 +512,7 @@ function ProcessModuleFile {
|
||||||
$mod.actions | Foreach {
|
$mod.actions | Foreach {
|
||||||
$action_file = ""
|
$action_file = ""
|
||||||
$current_action = @{}
|
$current_action = @{}
|
||||||
|
$script:current_module_path = $(Get-ChildItem $path).DirectoryName + "\" + $(Get-ChildItem $path).BaseName + '\'
|
||||||
foreach( $p in $_.psobject.properties.name ){
|
foreach( $p in $_.psobject.properties.name ){
|
||||||
$current_action[$p] = $_.$p
|
$current_action[$p] = $_.$p
|
||||||
}
|
}
|
||||||
|
@ -521,7 +522,7 @@ function ProcessModuleFile {
|
||||||
}
|
}
|
||||||
# If action content a file element, need to test if file exist
|
# If action content a file element, need to test if file exist
|
||||||
if ( $current_action.ContainsKey('file')) {
|
if ( $current_action.ContainsKey('file')) {
|
||||||
$action_file = $(Get-ChildItem $path).DirectoryName + "\" + $(Get-ChildItem $path).BaseName + "\" + $current_action.file
|
$action_file = $script:current_module_path + $current_action.file
|
||||||
if ( -not (Test-Path $action_file) ) {
|
if ( -not (Test-Path $action_file) ) {
|
||||||
Write-Host -ForegroundColor Red "`tError in $($mod.name) : file $action_file not found`n"
|
Write-Host -ForegroundColor Red "`tError in $($mod.name) : file $action_file not found`n"
|
||||||
return
|
return
|
||||||
|
|
Reference in a new issue