PowerShell Scripts - on Date and Time
Nov 20, 2021
PowerShell,
6788 Views
PowerShell Scripts - on Date and Time
PowerShell Scripts - on Date and Time
PowerShell - To Get System Date
Command - Get-Date is used to get the current date.
Get-Date
PowerShell - To Get System Time
Command - Get-Date -DisplayHint Time is used to get the current system time
Get-Date -DisplayHint Time
PowerShell - To Set System Time
Command - set-date adjust $timeToAdd is used to set time as required.
$timeToAdd = New-TimeSpan -Minutes -60
set-date -adjust $timeToAdd
PowerShell - To Set System Date
Command - Set-Date is used to set system Date
set-date -Date (Get-Date).AddDays(1)