Add robots.txt file to the root directory using PowerShell

$fileBytes = [system.io.file]::ReadAllBytes("c:\the\full\path\to\your\robots.txt");
$site = Get-SPSite "http://yourdomain:portifneeded";
$site.RootWeb.Files.Add("robots.txt", $fileBytes, $true); 
 
copied from:
http://www.jonthenerd.com/2011/08/17/sharepoint-2010-add-a-file-to-the-root-of-your-site-using-powershell/ 

Comments

Popular posts from this blog

Configure SharePoint Server to use Office Online Server

PowerShell command to import Module and Get-ADUser

Configure Office Web Apps for SharePoint 2013