You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on a new PSDeployment type for Scheduled task, came across this limitation with PSDeploy.
If there are parameter sets defined in the PSDeployScript e.g ScheduledTask.ps1, then Invoke-PSDeploy issues the warnings saying the parameters are not valid
[CmdletBinding(DefaultParameterSetName='SimpleTask')]
param(
[ValidateScript({ $_.PSObject.TypeNames[0] -eq'PSDeploy.Deployment' })]
[psobject[]]$Deployment,# Specify the Computer name
[String]$ComputerName,
)
$ComputerName
The parameters are not even splatted to the deployment script.
PS C:\PSDeployFrom> Invoke-PSDeploy .\ScheduledTask.psdeploy.ps1 -Force
WARNING: WithOption 'RunAsUser' is not a valid parameter for 'ScheduledTask'
WARNING: WithOption 'Once' is not a valid parameter for 'ScheduledTask'
WARNING: WithOption 'ComputerName' is not a valid parameter for 'ScheduledTask'
WARNING: WithOption 'At' is not a valid parameter for 'ScheduledTask'
WARNING: WithOption 'TaskName' is not a valid parameter for 'ScheduledTask'
WARNING: WithOption 'Credential' is not a valid parameter for 'ScheduledTask'
WARNING: WithOption 'TaskAction' is not a valid parameter for 'ScheduledTask'
The text was updated successfully, but these errors were encountered:
@RamblingCookieMonster I have figured out a way to pull out the valid parameters based on the arguments passed from the scriptblock passed to WithOptions.
I am clubbing them together in the same branch used for the ScheduledTask deployment type.
While working on a new PSDeployment type for Scheduled task, came across this limitation with PSDeploy.
If there are parameter sets defined in the PSDeployScript e.g ScheduledTask.ps1, then Invoke-PSDeploy issues the warnings saying the parameters are not valid
Below is the sample PSDeploy.ps1 used :-
The parameters are not even splatted to the deployment script.
The text was updated successfully, but these errors were encountered: