FOLIO-FSE / FOLIO-FSE/FolioClient-PowerShell

Minimum PowerShell Version?

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The requirements for this module indicate a minimum PowerShell version of 5.1. However, in a 5.1 environment, when running `Get-FolioRecordsByQuery` I get the error:

```
Get-Date : A parameter cannot be found that matches parameter name 'AsUTC'.
At \Modules\FolioClient\0.0.3\FolioClient.psm1:165 char:24
+ if (((Get-Date -AsUTC) -ge $this.TokenExpiry) -or ($force)) {
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-Date], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetDateCommand
```

It appears that the -AsUTC parameter didn't exist until version 7.4: https://learn.microsoft.com/en-us/dotnet/api/microsoft.powershell.commands.getdatecommand.asutc?view=powershellsdk-7.6.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in FolioClient.psm1 around line 165, where Get-FolioRecordsByQuery reaches the Get-Date -AsUTC call, and verify the behavior in a PowerShell 5.1 environment. Check how the module documents its minimum version and determine whether the compatibility requirement or the date handling needs to be corrected. Done means the stated support level matches the module's behavior and the command no longer produces this reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.