Open Matticusau opened 6 years ago
Hi Matt, The extension just contains the psake module and a bootstrap script to load the module and call Invoke-psake on your script. It seems that the #requires command doesn't find the loaded psake module.
I will try to do some testing to understand why.
Thanks @qetza I wasn't sure if I was doing something wrong or had missed something. If you need details of the build.psake.ps1 script I am using I can share it with you but I checked and it came from the Powershell/Plaster templates. Like you have called out though it seems to be an issue with the #requires statement and validating the psake module loaded in the extension.
What I did for the time being is a simple PowerShell task to run the following, but I would really like to use the Psake extension as it looks awesome
# Install NuGet
if ($null -eq (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue))
{
Install-PackageProvider -Name NuGet -Force -Scope CurrentUser;
}
# Install the required modules
if ($null -eq (Get-Module -Name Pester -ListAvailable -ErrorAction SilentlyContinue))
{
Install-Module -Name Pester -Force -Verbose -Scope CurrentUser -SkipPublisherCheck;
}
if ($null -eq (Get-Module -Name Psake -ListAvailable -ErrorAction SilentlyContinue))
{
Install-Module -Name Psake -Force -Verbose -Scope CurrentUser;
}
# run Psake Build
Invoke-PSake $PSScriptRoot\build.psake.ps1 -taskList Build
Been using Psake locally for a while but looking to setup CI/CD for my PowerShell Modules and found the Psake Extension. However when I point that at my build.psake.ps1 script it fails due to being unable to locate the psake module as per the requires tag. I think I got the build.psake.ps1 script from a scaffolding with Plaster, just not sure if I should be writing my own custom script to wrap the build.psake.ps1 or not, but then why would I use the psake extension as I could just use the PowerShell task as I already have done and it works.