Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Pester
shell: pwsh
Expand All @@ -38,7 +38,7 @@ jobs:
Invoke-Pester -Configuration $config

- name: Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
Expand Down
22 changes: 18 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The format is based on and uses the types of changes according to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [4.1.3] - 2026-05-06

### Added

Expand All @@ -17,10 +17,14 @@ Implement Pester tests for script functionality, resource management, and securi

SPSWakeUP.ps1:

- Fix variable name inconsistency in Invoke-SPSWebRequest — $webApp was assigned but $webapp (different case) was used when constructing the webSession authentication URL, causing the URL to be built from a null reference.

- The term 'Clear-SPSLog' is not recognized as the name of a cmdlet ([issue #34](https://github.com/luigilink/SPSWakeUp/issues/34)).
- Fix function name typo: Disable-IEFirsRun → Disable-IEFirstRun.
- Fix undefined variable bug in Get-SPSSitesUrl by removing unused $AllSites check.
- Fix inconsistent output methods by replacing Write-Host with Write-Output in Set-SPSProxySettings function.
- Fix inconsistent output methods by replacing Write-Host with Write-Output in Set-SPSProxySetting function.
- Fix bug in Remove-SPSSheduledTask where a caught exception left $TaskFolder unassigned, causing a second unhandled error on the next statement — added early return in the catch block.
- Fix Get-SPSInstalledProductVersion returning .FileVersion string instead of the FileVersionInfo object — callers use .ProductMajorPart and .ProductBuildPart which are FileVersionInfo properties, not string properties. Returning a string caused both to resolve as $null, and $null -le 12999 evaluates to $true in PowerShell (null coerces to 0), so the SharePoint 2013 PSSnapin branch was always taken regardless of the installed version. Updated [OutputType] to [System.Diagnostics.FileVersionInfo].

### Changed

Expand All @@ -31,6 +35,16 @@ SPSWakeUP.ps1:
- Add runspace job cleanup with Pipe.Dispose() in Invoke-SPSWebRequest to prevent memory leaks in multi-threading operations.
- Add module import check before Import-Module SharePointServer to prevent unnecessary re-imports.
- Improve resource management with proper cleanup in finally blocks and early exit scenarios.
- Cache $webapp.GetResponseUri('Default').AbsoluteUri result into $responseUri in Get-SPSWebAppUrl to avoid redundant method calls per loop iteration.
- Replace -Include with -Filter parameter in Get-ChildItem call in Clear-SPSLog for filesystem-level filtering and better performance.
- Replace -Include with -Filter parameter in Get-ChildItem call in Clear-HostsFileCopy and remove intermediate $extension variable.
- Replace single-use $Now intermediate variable with inline (Get-Date).AddDays(-$days) in Clear-SPSLog.
- Remove redundant $null -ne $file null guard inside foreach loop in Clear-SPSLog — Get-ChildItem never emits null items.
- Replace $Jobs and $Results array accumulation (@() + +=) with [System.Collections.Generic.List[object]]::new() and .Add() in Invoke-SPSWebRequest to avoid O(n²) array copy overhead on large URL sets.
- Remove $Host.UI.RawUI.WindowTitle assignment from initialization section.
- Remove unused Get-SPSVersion function.
- Add [CmdletBinding(SupportsShouldProcess)] and $PSCmdlet.ShouldProcess() guards to Remove-SPSSheduledTask and Set-SPSProxySetting to satisfy PSUseShouldProcessForStateChangingFunctions and enable -WhatIf/-Confirm support.
- Rename Invoke-SPSAdminSites → Invoke-SPSAdminSite, Invoke-SPSAllSites → Invoke-SPSAllSite, Set-SPSProxySettings → Set-SPSProxySetting to comply with PSUseSingularNouns convention.

Update release.yml to clarify workflow purpose

Expand Down Expand Up @@ -60,7 +74,7 @@ SPSWakeUP.ps1:

- Add new function:

- Set-SPSProxySettings | Backup, Disable and Restore IE Proxy Settings ([issue #26](https://github.com/luigilink/SPSWakeUp/issues/26)).
- Set-SPSProxySetting | Backup, Disable and Restore IE Proxy Settings ([issue #26](https://github.com/luigilink/SPSWakeUp/issues/26)).

Add README.md file for Installation guide in package release ([issue #25](https://github.com/luigilink/SPSWakeUp/issues/25)).

Expand Down Expand Up @@ -120,7 +134,7 @@ SPSWakeUP.ps1:
- Get-SPSInstalledProductVersion | Retrieves the version of the installed SharePoint product by checking the Microsoft.SharePoint.dll file.
- Install-SPSWakeUP | Installs the SPSWakeUp script by creating a scheduled task and configuring necessary permissions for the specified user.
- Invoke-SPSWebRequest | Sends HTTP requests to SharePoint URLs in a multi-threaded manner to warm up the sites.
- Invoke-SPSAdminSites | Sends HTTP requests to SharePoint Admin URLs to warms up SharePoint Central Administration site Pages.
- Invoke-SPSAdminSite | Sends HTTP requests to SharePoint Admin URLs to warms up SharePoint Central Administration site Pages.

- BREAKING CHANGE - Remove function:

Expand Down
41 changes: 39 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,49 @@
# SPSWakeUp - Release Notes

## [4.1.2] - 2026-02-10
## [4.1.3] - 2026-05-06

### Added

Implement Pester tests for script functionality, resource management, and security practices:

- .github/workflows/pester.yml
- tests/SPSWakeUP.Tests.ps1
- tests/README.md

### Fixed

SPSWakeUP.ps1:

- Add UseBasicParsing param in Invoke-WebRequest CmdLet ([issue #35](https://github.com/luigilink/SPSWakeUp/issues/35)).
- Fix variable name inconsistency in Invoke-SPSWebRequest — $webApp was assigned but $webapp (different case) was used when constructing the webSession authentication URL, causing the URL to be built from a null reference.

- The term 'Clear-SPSLog' is not recognized as the name of a cmdlet ([issue #34](https://github.com/luigilink/SPSWakeUp/issues/34)).
- Fix function name typo: Disable-IEFirsRun → Disable-IEFirstRun.
- Fix undefined variable bug in Get-SPSSitesUrl by removing unused $AllSites check.
- Fix inconsistent output methods by replacing Write-Host with Write-Output in Set-SPSProxySetting function.
- Fix bug in Remove-SPSSheduledTask where a caught exception left $TaskFolder unassigned, causing a second unhandled error on the next statement — added early return in the catch block.
- Fix Get-SPSInstalledProductVersion returning .FileVersion string instead of the FileVersionInfo object — callers use .ProductMajorPart and .ProductBuildPart which are FileVersionInfo properties, not string properties. Returning a string caused both to resolve as $null, and $null -le 12999 evaluates to $true in PowerShell (null coerces to 0), so the SharePoint 2013 PSSnapin branch was always taken regardless of the installed version. Updated [OutputType] to [System.Diagnostics.FileVersionInfo].

### Changed

SPSWakeUP.ps1:

- Add COM object cleanup with ReleaseComObject in Add-SPSSheduledTask and Remove-SPSSheduledTask functions to prevent memory leaks.
- Add Remove-Variable for sensitive data (passwords, credentials) to reduce security exposure in memory.
- Add runspace job cleanup with Pipe.Dispose() in Invoke-SPSWebRequest to prevent memory leaks in multi-threading operations.
- Add module import check before Import-Module SharePointServer to prevent unnecessary re-imports.
- Improve resource management with proper cleanup in finally blocks and early exit scenarios.
- Cache $webapp.GetResponseUri('Default').AbsoluteUri result into $responseUri in Get-SPSWebAppUrl to avoid redundant method calls per loop iteration.
- Replace -Include with -Filter parameter in Get-ChildItem call in Clear-SPSLog for filesystem-level filtering and better performance.
- Replace -Include with -Filter parameter in Get-ChildItem call in Clear-HostsFileCopy and remove intermediate $extension variable.
- Replace single-use $Now intermediate variable with inline (Get-Date).AddDays(-$days) in Clear-SPSLog.
- Remove redundant $null -ne $file null guard inside foreach loop in Clear-SPSLog — Get-ChildItem never emits null items.
- Replace $Jobs and $Results array accumulation (@() + +=) with [System.Collections.Generic.List[object]]::new() and .Add() in Invoke-SPSWebRequest to avoid O(n²) array copy overhead on large URL sets.
- Remove $Host.UI.RawUI.WindowTitle assignment from initialization section.
- Remove unused Get-SPSVersion function.
- Add [CmdletBinding(SupportsShouldProcess)] and $PSCmdlet.ShouldProcess() guards to Remove-SPSSheduledTask and Set-SPSProxySetting to satisfy PSUseShouldProcessForStateChangingFunctions and enable -WhatIf/-Confirm support.
- Rename Invoke-SPSAdminSites → Invoke-SPSAdminSite, Invoke-SPSAllSites → Invoke-SPSAllSite, Set-SPSProxySettings → Set-SPSProxySetting to comply with PSUseSingularNouns convention.

Update release.yml to clarify workflow purpose

## Changelog

Expand Down
Loading
Loading