Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Can't Understand Return Values

$
0
0

I have read several threads about this; must be I'm plain dumb or one of those "traditional programs'...

Any way, I set up a form with a DateTime Picker and in my onclick event

$button1_OnClick=

{

 

 

 

 

#TODO: Place custom script here

$cDate

 

 

=$dateTimePicker1.Value.ToString("yyyy-MM-dd")

Write-Host

 

 

$cDate

$form1

 

 

Close()

}

The Write-Host line is a check on the date I actually pcked, as I want the cDate var to be returned to an SQL statement.  Problem is: cDate always returns the current date in the Picker, not the date I selected. But the Write-Host returns the seleted date (in this case 2015-03-04 rather than 2015-03-08 which was the deafult date.

How does one retrun the selected date as formatted?


Viewing all articles
Browse latest Browse all 6937

Trending Articles