Last active
January 5, 2017 15:52
-
-
Save RobsonAutomator/51c8605235aac70314da9053c40475a2 to your computer and use it in GitHub Desktop.
add-bindings-and-hosts
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
#https://bitbucket.org/sitecoreautomationteam/sitecore-automation/wiki/Home | |
#https://www.powershellgallery.com/packages/sitecore-automation/0.9 | |
Import-Module sitecore-automation -force | |
# This file must exist | |
$devhosts = 'C:\Users\user\Desktop\dev.hosts' | |
# Path to config files | |
$webPath = 'E:\www\MyProject\Website\App_Config\Include\' | |
# Gets all configured <sites> | |
$hosts = Get-SitecoreSites -Path $webPath | Select-Object -ExpandProperty hostName | |
# Adds bindinds to specified IIS website | |
Add-SitecoreBindings -Hosts $hosts -WebSite "Sitecore" | |
foreach($hostName in $hosts) | |
{ | |
# Adds hosts entries in local hosts file (default C:\WINDOWS\System32\drivers\etc\hosts) | |
New-SitecoreHostsEntry -IpAddress 127.0.0.1 -HostName $hostName | |
# Add hosts entires to hosts file used on your local machine | |
New-SitecoreHostsEntry -IpAddress 10.10.10.10 -HostName $hostName -Path $devhosts | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment