Issue after update to v3.1.12
Posted: Thu Oct 25, 2012 3:26 pm
I have an issue after I upgraded v3.1.12. I don't know if it's a bug or I have to set an option in the newer version. Basically I have a timer event on the form I created that worked in v3.0.8 but does not work in v3.1.12
In the frm_Load section i have the following:
$StartTime = $(get-Date).AddSeconds(30)
$timer1.Start()
In the timer1_Tick section I have:
$TimeDiff = New-TimeSpan $(Get-Date) $StartTime
....and performing other stuff.
In v3.1.12 the following errors returns:
ERROR: New-TimeSpan : Cannot bind parameter 'End' to the target. Exception setting "End": "Object reference not set to an instance of an object."
PostInstall_Info.pff (159): ERROR: At Line: 159 char: 39
ERROR: + $TimeDiff = New-TimeSpan $(Get-Date) $StartTime
ERROR: + ~~~~~~~~~~
ERROR: + CategoryInfo : WriteError: (:) [New-TimeSpan], ParameterBindingException
ERROR: + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.NewTimeSpanCommand
What I noticed after I step through the program is that as soon as I leave the frm_Load section, $StartTime is immediately reset to $null. I guess the errors stem from $StartTime being set to $null. I am still new to this programming so I'm sorry if the solution is something simple. This happens on a physical system and on a virtual machine (VMWare) and I must note that I'm still in my trial period for PowerStudio. However, as I stated earlier, the code works flawless in v3.0.8
Is it something I'm doing wrong?
In the frm_Load section i have the following:
$StartTime = $(get-Date).AddSeconds(30)
$timer1.Start()
In the timer1_Tick section I have:
$TimeDiff = New-TimeSpan $(Get-Date) $StartTime
....and performing other stuff.
In v3.1.12 the following errors returns:
ERROR: New-TimeSpan : Cannot bind parameter 'End' to the target. Exception setting "End": "Object reference not set to an instance of an object."
PostInstall_Info.pff (159): ERROR: At Line: 159 char: 39
ERROR: + $TimeDiff = New-TimeSpan $(Get-Date) $StartTime
ERROR: + ~~~~~~~~~~
ERROR: + CategoryInfo : WriteError: (:) [New-TimeSpan], ParameterBindingException
ERROR: + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.NewTimeSpanCommand
What I noticed after I step through the program is that as soon as I leave the frm_Load section, $StartTime is immediately reset to $null. I guess the errors stem from $StartTime being set to $null. I am still new to this programming so I'm sorry if the solution is something simple. This happens on a physical system and on a virtual machine (VMWare) and I must note that I'm still in my trial period for PowerStudio. However, as I stated earlier, the code works flawless in v3.0.8
Is it something I'm doing wrong?