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;
#######################################################################
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