Closed Windos closed 4 years ago
When running the sample script interactively, the use of $PSScriptRoot results in errors if your working directory isn't the expected directory.
$PSScriptRoot
Dynamically locate the module and reference the example script accordingly.
Offending line is number 69:
$Script = New-UAScript -Name "New User Onboarding Request" -ManualTime 28000 -ScriptBlock ([scriptblock]::Create((Get-Content "$PSScriptRoot\UniversalAutomation.Dashboard\examplescripts\onboarding.ps1"))) -Status "Draft"
Suggest change to:
$Script = New-UAScript -Name "New User Onboarding Request" -ManualTime 28000 -ScriptBlock ([scriptblock]::Create((Get-Content "$((Get-Module UniversalAutomation.Dashboard -ListAvailable).ModuleBase)\examplescripts\onboarding.ps1"))) -Status "Draft"
This shouldn't have been included with the sample script. It was part of one of our demo scripts and not a function of UA. I've fixed the sample script.
Describe the Issue
When running the sample script interactively, the use of
$PSScriptRoot
results in errors if your working directory isn't the expected directory.To Reproduce
Expected behavior
Dynamically locate the module and reference the example script accordingly.
Screenshots
Script Sample
Offending line is number 69:
Suggest change to:
Version Information