Parameter values are defined when adding new parameter task. How to write scripts which read in the parameters for execution?
The below script will accept the parameters from scheduled task and create the output in mentioned path.
param([int]$a,[int]$b)
$a= $Task.DirObj.Parameters.Value("a").Value
$b= $Task.DirObj.Parameters.Value("b").Value
$a | Out-File -FilePath "C:\Home\Test.txt"
$b | Out-File -append -FilePath "C:\Home\Test.txt"
function add([int]$c,[int]$d)
{
$var=$c+$d
$d + $c | Out-File -append -FilePath "C:\Home\Test.txt"
}
add -c $a -d $b
© 2021 One Identity LLC. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy