- Products
- Solutions
- Resources
- Trials
- Support
- Partners
- Communities
For whatever reason, I find teh VBS method to be much simpler -- but here's a sample section from a PowerShell Scheduled Task that we are running in ARS 6.7:
All values (OverwriteFile, LogFilePath, LogFileName, Environment) are set via the GUI for the SchTask and read in at runtime...
Just plop your "Work Code" after this section that reads in your parameters...
Hope that helps you out...
---Clip---
#Read in the Parameters for the Task
$objTask = [ADSI]$Task.AdsPath
$params = $objTask.InvokeGet("Parameters")
$params | ForEach-Object -Process {
if ($_.'Name' -eq "OverwriteFile")
{
$SetOverWritePolicy = [string]$_.'Value'
}
elseif ($_.'Name' -eq "LogFilePath")
{
$strLogFilePath = [string]$_.'Value'
}
elseif ($_.'Name' -eq "LogFileName")
{
$strLogFile = [string]$_.'Value'
$strLogBackup = $strLogFile + "_backup"
}
elseif ($_.'Name' -eq "Environment")
{
$Environment = [string]$_.'Value'
}
}
---End---
For whatever reason, I find teh VBS method to be much simpler -- but here's a sample section from a PowerShell Scheduled Task that we are running in ARS 6.7:
All values (OverwriteFile, LogFilePath, LogFileName, Environment) are set via the GUI for the SchTask and read in at runtime...
Just plop your "Work Code" after this section that reads in your parameters...
Hope that helps you out...
---Clip---
#Read in the Parameters for the Task
$objTask = [ADSI]$Task.AdsPath
$params = $objTask.InvokeGet("Parameters")
$params | ForEach-Object -Process {
if ($_.'Name' -eq "OverwriteFile")
{
$SetOverWritePolicy = [string]$_.'Value'
}
elseif ($_.'Name' -eq "LogFilePath")
{
$strLogFilePath = [string]$_.'Value'
}
elseif ($_.'Name' -eq "LogFileName")
{
$strLogFile = [string]$_.'Value'
$strLogBackup = $strLogFile + "_backup"
}
elseif ($_.'Name' -eq "Environment")
{
$Environment = [string]$_.'Value'
}
}
---End---