Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

declaring variable confusion

$
0
0

I have had a few head scratching sessions with variables not being the type that I thought they were.

$myDate = Get-Date

does not always yield a date type for me.  Sometimes it yeilds type string for me.  So $myDate.dayofWeek is a null.

I am not sure how this happens.  I got around it by statically declaring the type.  What do most people do?


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>