PowerShell Script in PostBuild

前端 未结 2 931
小蘑菇
小蘑菇 2020-12-30 03:17

Continuous Integration

I have been working on a PowerShell script to keep our development process streamlined. I was planning on running it as a post-build event,

2条回答
  •  遥遥无期
    2020-12-30 03:39

    Looks like your problem is how relative paths are resolved. Relative paths are resolved based on the current location (stored in $pwd) and not based on the location of the script. So if you launched the script from C:\, it definitely would not work.

    I would suggest you calculate the paths based on an argument (like Peter Seale shows), or grab the actual location of the script from:

    $MyInvocation.MyCommand.Path
    

提交回复
热议问题