Dot source powershell scripts are not included when bundling

Issue #29 resolved
Joshua Sukhdeo created an issue

Dot sourced powershell scripts are not included when bundling is checked and the project is built.

My main project and a test with two scripts can make an exe, but dot sourced scripts are not bundled whether using bundling or packaage as exe.

Visual Studio - Version 15.9.2

PoshTools - Version 4.0.31

$PSVersionTable Name Value ---- ----- PSVersion 5.1.17134.407 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.407 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Comments (3)

  1. Adam Driscoll

    Can you please provide me with a snippet of how you are trying to dot source your scripts?

    I just tried these examples and they worked:

    . "$PSScriptRoot\script2.ps1
    . (Join-Path $PSScriptRoot "script2.ps1")
    . ".\Script1.ps1"
    
  2. Joshua Sukhdeo reporter

    Hey, I was trying: . \Script1.ps1

    I didn't realize that I wasn't specifying the path properly. As soon as I added another dot, it worked out.

    Thanks for the quick reply

  3. Log in to comment