Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Question of PowerShell vs. CMD/BATCH

$
0
0

I have a little issue that is starting to come up in more of my scripts as I am slowly moving my scripts from BATCH to PowerShell.

My question is, how do I do this (ECHO %DATE%:~0,3%) from my BATCH scripts in a PowerShell script?

I've found one way I can get the small piece of information I need but I'm not satisfied with how I have to go about getting it.

I almost think it is possible to do this a bit simpler than:

_____________________________________________

$DATERAW = Get-Date
$DAYWEEK = $DATERAW.DayOfWeek
$DAYQUTE = "$DAYWEEK"
$DAYABRV = $DAYQUTE.Remove(3)
ECHO $DAYABRV

_____________________________________________

Any insight would be appriciated.

Thank you in advance.

Daniel

Assistant IT MGR


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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