GitHub action pipeline, im running a PowerShell script to install a tool in a server.
i created a step to fetch the PowerShell script file with invoke-azvmruncommand.
in Powershell script, we need to pass some variables, for that im using dev folder and add a variable.ps1 file, and added variables like storage account and container variables and values.
now im setup a step in workflow like:
– name: Agent Install
uses: Azure/powershell@v2
with:
inlineScript: |
. .${{env.ENV}}Post-Provisioning-variables.ps1
$vm_name = Get-Content win.ps1
$lastcount=$vm_name.count-1
$target=@{}
for ($i=3; $i -lt $lastcount; $i++) {
$vm_name1= $null
$vm_name1=$vm_name[$i].split(” “)
$target.Add($vm_name1[0],$vm_name1[$vm_name1.count-1])
}
$target.GetEnumerator() | ForEach-Object{
$azParmsAWAInstall = @{
ResourceGroupName = $.Value
VMName = $.Key
CommandId = “RunPowerShellScript”
ScriptPath = “./provisioning/AMA_Install.ps1”
}
Invoke-AzVMRunCommand @azParmsAWAInstall -Parameter @{storageblobname = “$storageblobname_window”; storageaccount = “$storageaccount”;storagecontainer=”$container_name”;
}
}
}
im getting error like below:
.: /home/runner/work/_temp/489fe56b-78a3-4e08-9768-f4201c018450.ps1:3
Line |
3 | . .devvariables.ps1
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The term ‘.nonprodPost-Provisioning-variables.ps1’ is not recognized
| as a name of a cmdlet, function, script file, or executable program.
| Check the spelling of the name, or if a path was included, verify that
| the path is correct and try again.
Error: Error: The process ‘/usr/bin/pwsh’ failed with exit code 1
.: /home/runner/work/_temp/489fe56b-78a3-4e08-9768-f4201c018450.ps1:3
Line |
3 | ./provisioning/AMA_Install.ps1
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The term ‘.nonprodPost-Provisioning-variables.ps1’ is not recognized
| as a name of a cmdlet, function, script file, or executable program.
| Check the spelling of the name, or if a path was included, verify that
| the path is correct and try again.
Error: Error: The process ‘/usr/bin/pwsh’ failed with exit code 1
please help me why i’m getting this error, previously its working.
now its not working.
The GitHub step is working previously, but not working now, why?
what is the problem here?