Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 512

PowerShell Studio • Re: dot sourcing and debugging

$
0
0
So I had a ps1 file with multiple lines dotsourcing my functions like:
. \\ps\functions$\add-thingy.ps1

...and that all worked fine.
I thought it was more efficient to not specify each line so I changed that ps1 file to remove all the individual dotsourcing lines and run this code:

Code:

$functionpath = '\\ps\functions$\'$functions = Get-ChildItem -path "$functionpath\*.ps1" -name | where { $_ -notlike '*tempPoint*' }foreach ($function in $functions) {    . ($functionpath + $function)}
When I run this in the PS studio console all is fine. But when I build an exe package it doesnt work.
Any ideas?
Thanks
David

Statistics: Posted by Lembasts — Mon Sep 30, 2024 6:48 pm



Viewing all articles
Browse latest Browse all 512

Trending Articles