Skip to content

Commit

Permalink
Merge pull request #192 from 15below/develop
Browse files Browse the repository at this point in the history
SetSitePathWithConnectAs & EnsurePath Tweak
  • Loading branch information
martyn-osborne authored Aug 1, 2024
2 parents 54a94d3 + 7f69971 commit 9daf343
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using System.Text.RegularExpressions;
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

var baseVersion = "1.26.0";
var baseVersion = "1.27.0";
var subVersion = "";
var subVersionNumber = "";
var isMasterOrDevelop = false;
Expand Down
29 changes: 29 additions & 0 deletions docs/powershell/create-website/set-site-path-with-connect-as.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: createWebsite.ps1 - SetSitePathWithConnectAs
linkText: SetSitePathWithConnectAs
description: Details about the SetSitePathWithConnectAs function in createWebsite.ps1 helper script
---

# StartAppPool

```PowerShell
{% raw %}
SetSitePathWithConnectAs
[-name] <String>
[-path] <String>
[-username] <String>
[-password] <String>
{% endraw %}
```

## Description

Sets the site physical path with connect as set to a dedicated user

## Example

```PowerShell
{% raw %}
SetSitePathWithConnectAs -name "MySite" -path "\\remoteshare\folder" -username "MyUser" -password "5ecureP@ssw0rd
{% endraw %}
```
7 changes: 7 additions & 0 deletions src/Scripts/createWebSite.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -679,5 +679,12 @@ function SetAppPoolAlwaysRunning([string] $appPoolName)
Set-ItemProperty IIS:\AppPools\$appPoolName processModel.idleTimeout "00:00:00"
}

function SetSitePathWithConnectAs([string] $name, [string]$path, [string] $userName, [string] $password)
{
Set-ItemProperty IIS:\Sites\$name -name userName -value $userName
Set-ItemProperty IIS:\Sites\$name -name password -value $password
Set-ItemProperty IIS:\Sites\$name -name physicalPath -value $path
}

Write-Host "Ensconce - CreateWebsite Loaded"
$createWebSiteLoaded = $true
3 changes: 2 additions & 1 deletion src/Scripts/deployHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ function EnsurePath([string]$name)

if ((Test-Path $path) -eq $False)
{
md $path
Write-Host "Path '$path' does not exist, try to create"
New-Item -ItemType Directory -Path $path -ErrorAction Continue
}
}

Expand Down

0 comments on commit 9daf343

Please sign in to comment.