This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Restrict IIS website to be only accessible locally. | |
$SiteName = "MySiteName" | |
# secure site - Restrict IP | |
Set-WebConfigurationProperty -Filter /system.webserver/security/ipsecurity -Name allowUnlisted -Value $false -Location $SiteName | |
add-webconfiguration /system.webServer/security/ipSecurity -location $SiteName -value @{ipAddress="localhost";allowed="true"} -pspath IIS:\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code will create an IIS site and it associated Application Pool. | |
# Please note that you will be required to run PS with elevated permissions. | |
# Visit http://ifrahimblog.wordpress.com/2014/02/26/run-powershell-elevated-permissions-import-iis-module/ | |
# set-executionpolicy unrestricted | |
$SiteFolderPath = "C:\WebSite" # Website Folder | |
$SiteAppPool = "MyAppPool" # Application Pool Name | |
$SiteName = "MySite" # IIS Site Name | |
$SiteHostName = "www.MySite.com" # Host Header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run PowerShell with elevated permissions for IIS Module, run through the following steps | |
# Create a PowerShell shortcut and update its target path as: | |
# %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "import-module webadministration | out-null" | |
# This will import IIS Module in PowerShell enabling you to access IIS services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits umbraco.MacroEngines.DynamicNodeContext | |
@using umbraco.BusinessLogic; | |
@using umbraco.cms.businesslogic.web; | |
@{ | |
var thisModel = @Model; | |
foreach (var page in thisModel.Children) | |
{ | |
var doc = new Document(page.Id); | |
var publishAt = doc.ReleaseDate; | |
var removeAt = doc.ExpireDate; |