简体   繁体   中英

PowerShell with a configuration script

Needs some help. We run PowerShell scripts using a configuration script.

eg .\\folderA\\TheConfigurationScript .\\scriptThatDoesAllTheWork.ps1

The issue is that in the directory where scriptThatDoesAllTheWork.ps1 is located there are number of other scripts.

If I accidentally add a space before scriptThatDoesAllTheWork.ps1 all scripts located in that folder are executed

eg .\\folderA\\TheConfigurationScript .\\ scriptThatDoesAllTheWork.ps1

All variables therefore defined in folderA\\TheConfigurationScript are available to scriptThatDoesAllTheWork.ps1 that does all the work

Is there any way to avoid this behaviour

Thanks in advance

Thanks to mclayton. I had a get-childitem that would return all the files in case of space. In case this helps anyone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM