Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

Running a script from Powershell

$
0
0

I can run a script from Powershell to delete sharepoint files, but as soon I create a task the script starts but does not complete the task. I have added a line to the script to launch Powershell

Add-PsSnapin Microsoft.SharePoint.PowerShell
get-childitem D:\Backupfarm\PFS -recurse | where {$_.lastwritetime -lt (get-date).adddays(-7) -and -not $_.psiscontainer} |% {remove-item $_.fullname -force}


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>