Friday, May 31, 2013

Warm Up Script for SharePoint

You can use this warm up script after deployment in SharePoint it will bring back your site faster thna browser.


Write below line in text file and save as BAT file


####################################################################
powershell -command "& 'D:\Satish\WarmUp\Satish\WarmUp.ps1'"
####################################################################


Write Below lines in text file and save as ps1 file


####################################################################
    $ver = $host | select version
    if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} 
    if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
        Add-PSSnapin "Microsoft.SharePoint.PowerShell"
    }
    
   function Get-WebPage([string]$url)
   {
       $wc = new-object net.webclient;
       $wc.credentials = [System.Net.CredentialCache]::DefaultCredentials;
      $pageContents = $wc.DownloadString($url);
      $wc.Dispose();
     return $pageContents;
   }
   

write-host "http://igtehydzbnv02:2210/sites/AppCentralSatish/";
$html = Get-WebPage -url "http://igtehydzbnv02:2210/sites/AppCentralSatish/";
write-host "Done";
read-host;
#######################################################################

No comments:

Post a Comment

Seven steps to build and deploy SPFX web part to SharePoint

Install Node.JS Use this link to install Node.JS https://nodejs.org/en/ 2.        Install yeomen and gulp CMD>npm install –g y...