Skip to content

Commit

Permalink
Merge pull request #6 from BrianFarnhill/Bug-PowerShellSessionTimeOut
Browse files Browse the repository at this point in the history
Bug power shell session time out
  • Loading branch information
BrianFarnhill committed Jul 30, 2015
2 parents 7776bbf + 15078c2 commit cbe3762
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
16 changes: 13 additions & 3 deletions Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ function Get-xSharePointAuthenticatedPSSession() {
[System.Boolean]
$ForceNewSession = $false
)

$session = @(Get-PSSession | Where-Object { $_.ComputerName -eq $env:COMPUTERNAME -and $_.Runspace.OriginalConnectionInfo.Credential.UserName -eq $Credential.UserName})

$session = @(Get-PSSession | Where-Object { $_.ComputerName -eq "." -and $_.Runspace.OriginalConnectionInfo.Credential.UserName -eq $Credential.UserName -and $_.State -eq "Open"})

if (($session.Count -eq 0) -or ($ForceNewSession -eq $true)) {
Write-Verbose -Message "Creating new PowerShell session"
$session = New-PSSession -ComputerName $env:COMPUTERNAME -Credential $Credential -Authentication CredSSP
$session = New-PSSession -ComputerName "." -Credential $Credential -Authentication Credssp -SessionOption (New-PSSessionOption -OperationTimeout 600000 -SkipCACheck -SkipCNCheck -SkipRevocationCheck)
Invoke-Command -Session $session -ScriptBlock {
if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue))
{
Expand Down Expand Up @@ -68,4 +68,14 @@ function Remove-xSharePointNullParamValues() {
return $Params
}

function Get-xSharePointAssemblyVerion() {
[CmdletBinding()]
param
(
[parameter(Mandatory = $true,Position=1)]
$PathToAssembly
)
return (Get-Command $PathToAssembly).Version
}

Export-ModuleMember -Function *
6 changes: 3 additions & 3 deletions Modules/xSharePoint/xSharePoint.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
# RootModule = ''

# Version number of this module.
ModuleVersion = '0.4.0.0'
ModuleVersion = '0.3.1.0'

# ID used to uniquely identify this module
GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90'

# Author of this module
# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = '(c) 2015 Microsoft Corporation. All rights reserved.'
Copyright = '(c) 2015 Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'This DSC module is used to deploy and configure SharePoint Server 2013, and convers a wide range of areas including web apps, service apps and farm configuration.'
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.2.0.{build}
version: 0.3.1.{build}

install:
- cinst -y pester
Expand Down

0 comments on commit cbe3762

Please sign in to comment.