spjeff / sppatchify

SharePoint Patchify - centralized tool to apply CU patch to entire farm from one console
MIT License
1 stars 0 forks source link

Remove-PSSession invalid parameter #21

Closed hpimentao closed 6 years ago

hpimentao commented 6 years ago

Hi Jeff,

While running the script I've got an error when it tries to kill the PSSession, the "-Force" parameter cannot be found. At line 101, I think it should be: Get-PSSession | Remove-PSSession -Confirm:$false

Error message:

PS>TerminatingError(Remove-PSSession): "A parameter cannot be found that matches parameter name 'Force'." Remove-PSSession : A parameter cannot be found that matches parameter name 'Force'. At ..\SPPatchify.ps1:101 char:38 Get-PSSession | Remove-PSSession -Force


     CategoryInfo          : InvalidArgument: (:) [Remove-PSSession], ParameterBindingException
     FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemovePSSessionCommand

Apart from this issue, the script runs very well. Great work!

All the best,

HP

spjeff commented 6 years ago

Thank you. Updated. https://github.com/spjeff/sppatchify/commit/e6eb8f4794de77190bbe31503ae330d376a217f7#diff-5918760c8d2458204dcbb74d9364e7d7