Skip to content

Instantly share code, notes, and snippets.

View BeniFreitag's full-sized avatar

Benjamin Freitag BeniFreitag

View GitHub Profile
@BeniFreitag
BeniFreitag / 0_reuse_code.js
Created April 16, 2014 09:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Get-SPSite -Limit ALL | ForEach-Object {
$siteCollection = $PSItem
$siteCollection.AllWebs | ForEach-Object {
$web = $PSItem
$sitePages = $web.Lists["Site Pages"]
if ($sitePages) {
$sitePages.Items | Where-Object { $_["_CommentCount"] -ge 1 } | ForEach-Object {
$sitePage = $PSItem
$pageUrl = $web.Url + "/" + $sitePage.Url