Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Child script stacking

$
0
0

A little over a year ago I took over managing a menu driven powershell tool.  One of the things this script can do is spawn child scripts.  There are 4 files involved in this tool

Main.ps1, Settings.ps1, Functions.ps1, VFHandler.ps1

When you call Main it includes settings, which includes functions (is that the right term? or is it references?).  There is a command that will launch vfhandler, which acts in place of main and includes settings (which includes functions).

When vfhandler is called it is stacked under the parent script and takes on the same colorizing of the parent.

So, recently I made a copy of the script and started editing it so that I can re-purpose it for another function.  And so far it is working well.  But, the issue I have is that child script is not stacking under the new script but is stacking under the original one and I am not sure if there was a way to get the child script stacking under it's parent.

EDIT:

Forgot to include how the original script is launched.  I use a shortcut with a path similar to powershell.exe -NoProfile -NoExit -NoLogo -ExecutionPolicy bypass -File .\main.ps1 and the folder path set as Start In.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles