Posts

Convert Time Zone from UTC to Local time using SharePoint 2010 Power Shell script

Function Get-LocalTime($UTCTime) { $UTCTime = [datetime]::ParseExact($UTCTime,"MM/dd/yyyy HH:mm:ss", [System.Globalization.CultureInfo]::CurrentCulture) $LocalTime = $UTCTime.ToLocalTime().ToString("MM/dd/yyyy HH:mm:ss") Return $LocalTime } $UTCtime="04/03/2016 12:17:09" $localTime = Get-LocalTime $UTCtime Write-Host "UTC Time: $($DateString); Local Time: $($localTime)"

Power Shell script beginner in SharePoint 2010

PowerShell in Sharepoint 2010 – Basics Part 1 5.00 / 5  5 1 / 5 2 / 5 3 / 5 4 / 5 5 / 5 2  votes,  5.00  avg. rating ( 97 % score) Introduction In PowerShell basic series part 1, we can learn how to work with  variables ,  arrays  and  hashtables . The basic series is very important to understand the complex codes of powershell. This series will be worth reference guide as most of powershell developers are not aware of the syntax and usage. Usage Variables Following is the simplest way of creating variables and assign value 1 2 $firstName = "Adi" $empId = 999 Other commands to create, retrieve and set variables New-Variable  cmdlet is used to create variables with additional features like description and options like setting as readonly variable Following code creates new readonly variable ‘SiteName’ and assigns value to it. It also provides description what the variable is 1 New-Variable -Na...