121k views
0 votes
Using the cmdlet, get-date, and select-object, display on the current day of the week in a table like the following (Caution: the output will right-align, so make sure your Powershell window doesn't have a horizontal scroll bar)

DayofWeek
-------------
Monday

User Ozba
by
7.7k points

1 Answer

3 votes

Final answer:

To display the current day of the week using the cmdlet Get-Date and Select-Object in PowerShell, use the command Get-Date | Select-Object -Property DayOfWeek.

Step-by-step explanation:

To display the current day of the week using the cmdlet Get-Date and Select-Object in PowerShell, you can use the following command:

Get-Date | Select-Object -Property DayOfWeek

This command retrieves the current date and time using Get-Date and then selects the DayOfWeek property using Select-Object. The output will be displayed in a table-like format with the column header 'DayOfWeek' and the current day of the week.

User Noobiehacker
by
7.5k points