Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of Port in Read-SPWebapplications #90

Open
kayodebristol opened this issue Nov 8, 2019 · 0 comments
Open

Incorrect handling of Port in Read-SPWebapplications #90

kayodebristol opened this issue Nov 8, 2019 · 0 comments

Comments

@kayodebristol
Copy link

Function Read-SPWebApplication produces DSC Configuration where Port property is blank if actual port doesn't equal 80

if($results.WebAppURl.Contains(":") -and $results.Port -and $results.Port -ne 80)
{
   $results.Remove("Port")
}
elseif(!$results.WebAppUrl.Contains(":") -and !$results.Port)
{
   $results.Add("Port", 80)
}

In the case where the actual WebApplication is using port 443 or any port other that 80, the resulting config, where port property is not specified, causes SharePoint to generate a SPWebApplication with a randomly generated port.

To resolve, suggest:

<# Removing port will cause randomly generated port value, don't do this
if($results.WebAppURl.Contains(":") -and $results.Port -and $results.Port -ne 80)
{
   $results.Remove("Port")
}
#>
#If port value is not supplied, assume port 80
if(!$results.WebAppUrl.Contains(":") -and !$results.Port)
{
   $results.Add("Port", 80)
}
kayodebristol pushed a commit to kayodebristol/SharePointDSC.Reverse that referenced this issue Nov 8, 2019
kayodebristol pushed a commit to kayodebristol/SharePointDSC.Reverse that referenced this issue Nov 13, 2019
kayodebristol pushed a commit to kayodebristol/SharePointDSC.Reverse that referenced this issue Nov 14, 2019
kayodebristol added a commit to kayodebristol/SharePointDSC.Reverse that referenced this issue Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant