Skip to content

Commit

Permalink
Merge pull request #254 from TheJumpCloud/SA-1262_string_valid_datetime
Browse files Browse the repository at this point in the history
Sa 1262 string valid datetime
  • Loading branch information
Elliott Panipinto authored Aug 18, 2020
2 parents 41dcbe4 + 1750bb8 commit 4cc9bf0
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 30 deletions.
6 changes: 3 additions & 3 deletions PowerShell/JumpCloud Module/Docs/Get-JCSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Get-JCSystem [[-hostname] <String>] [-displayName <String>] [-version <String>]
[-systemTimezone <String>] [-active <Boolean>] [-allowMultiFactorAuthentication <Boolean>]
[-allowPublicKeyAuthentication <Boolean>] [-allowSshPasswordAuthentication <Boolean>]
[-allowSshRootLogin <Boolean>] [-modifySSHDConfig <Boolean>] [-hasServiceAccount <Boolean>]
[-filterDateProperty <String>] [-returnProperties <String[]>] -dateFilter <String> -date <String>
[-filterDateProperty <String>] [-returnProperties <String[]>] -dateFilter <String> -date <DateTime>
[<CommonParameters>]
```

### ByID
```
Get-JCSystem -SystemID <String> [-SystemFDEKey] -dateFilter <String> -date <String> [<CommonParameters>]
Get-JCSystem -SystemID <String> [-SystemFDEKey] -dateFilter <String> -date <DateTime> [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -216,7 +216,7 @@ Accept wildcard characters: False
Date to filter on.
```yaml
Type: System.String
Type: System.DateTime
Parameter Sets: (All)
Aliases:

Expand Down
6 changes: 3 additions & 3 deletions PowerShell/JumpCloud Module/Docs/Get-JCUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Get-JCUser [[-username] <String>] [-firstname <String>] [-lastname <String>] [-e
[-filterDateProperty <String>] [-returnProperties <String[]>] [-middlename <String>] [-displayname <String>]
[-jobTitle <String>] [-employeeIdentifier <String>] [-department <String>] [-costCenter <String>]
[-company <String>] [-employeeType <String>] [-description <String>] [-location <String>]
[-external_dn <String>] [-external_source_type <String>] -dateFilter <String> -date <String>
[-external_dn <String>] [-external_source_type <String>] -dateFilter <String> -date <DateTime>
[<CommonParameters>]
```

### ByID
```
Get-JCUser -userid <String> -dateFilter <String> -date <String> [<CommonParameters>]
Get-JCUser -userid <String> -dateFilter <String> -date <DateTime> [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -153,7 +153,7 @@ Accept wildcard characters: False
Date to filter on.
```yaml
Type: System.String
Type: System.DateTime
Parameter Sets: (All)
Aliases:

Expand Down
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/JumpCloud.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>JumpCloud</id>
<version>1.18.0</version>
<version>1.18.1</version>
<description>PowerShell functions to manage a JumpCloud Directory-as-a-Service</description>
<authors>JumpCloud Solutions Architect Team</authors>
<owners>JumpCloud</owners>
Expand Down
4 changes: 2 additions & 2 deletions PowerShell/JumpCloud Module/JumpCloud.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: JumpCloud Solutions Architect Team
#
# Generated on: 8/14/2020
# Generated on: 8/15/2020
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'JumpCloud.psm1'

# Version number of this module.
ModuleVersion = '1.18.0'
ModuleVersion = '1.18.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
6 changes: 2 additions & 4 deletions PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Function Get-JCSystem ()
# Add the attributes to the attributes collection
$AttributeCollection.Add($ParameterAttribute)
# Create and return the dynamic parameter
$RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParamName_FilterDate, [string], $AttributeCollection)
$RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParamName_FilterDate, [datetime], $AttributeCollection)
$RuntimeParameterDictionary.Add($ParamName_FilterDate, $RuntimeParameter)


Expand Down Expand Up @@ -326,9 +326,7 @@ Function Get-JCSystem ()

if ($param.key -eq 'date')
{

$ConvertDate = [DateTime]::Parse($param.value)
$Timestamp = Get-Date $ConvertDate -format o
$Timestamp = Get-Date $param.Value -format o

continue
}
Expand Down
6 changes: 2 additions & 4 deletions PowerShell/JumpCloud Module/Public/Users/Get-JCUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Function Get-JCUser ()
# Add the attributes to the attributes collection
$AttributeCollection.Add($ParameterAttribute)
# Create and return the dynamic parameter
$RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParamName_FilterDate, [string], $AttributeCollection)
$RuntimeParameter = New-Object System.Management.Automation.RuntimeDefinedParameter($ParamName_FilterDate, [datetime], $AttributeCollection)
$RuntimeParameterDictionary.Add($ParamName_FilterDate, $RuntimeParameter)

# Returns the dictionary
Expand Down Expand Up @@ -278,9 +278,7 @@ Function Get-JCUser ()

if ($param.key -eq 'date')
{

$ConvertDate = [DateTime]::Parse($param.value)
$Timestamp = Get-Date $ConvertDate -format o
$Timestamp = Get-Date $param.Value -format o

continue
}
Expand Down
24 changes: 12 additions & 12 deletions PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5846,9 +5846,9 @@
<maml:Description>
<maml:para>Date to filter on.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">System.String</command:parameterValue>
<command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue>
<dev:type>
<maml:name>System.String</maml:name>
<maml:name>System.DateTime</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
Expand Down Expand Up @@ -5973,9 +5973,9 @@
<maml:Description>
<maml:para>Date to filter on.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">System.String</command:parameterValue>
<command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue>
<dev:type>
<maml:name>System.String</maml:name>
<maml:name>System.DateTime</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
Expand Down Expand Up @@ -6275,9 +6275,9 @@
<maml:Description>
<maml:para>Date to filter on.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">System.String</command:parameterValue>
<command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue>
<dev:type>
<maml:name>System.String</maml:name>
<maml:name>System.DateTime</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
Expand Down Expand Up @@ -7109,9 +7109,9 @@
<maml:Description>
<maml:para>Date to filter on.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">System.String</command:parameterValue>
<command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue>
<dev:type>
<maml:name>System.String</maml:name>
<maml:name>System.DateTime</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
Expand Down Expand Up @@ -7521,9 +7521,9 @@
<maml:Description>
<maml:para>Date to filter on.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">System.String</command:parameterValue>
<command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue>
<dev:type>
<maml:name>System.String</maml:name>
<maml:name>System.DateTime</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
Expand Down Expand Up @@ -7624,9 +7624,9 @@
<maml:Description>
<maml:para>Date to filter on.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">System.String</command:parameterValue>
<command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue>
<dev:type>
<maml:name>System.String</maml:name>
<maml:name>System.DateTime</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
Expand Down
3 changes: 2 additions & 1 deletion PowerShell/ModuleBanner.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#### Latest Version

```
1.18.0
1.18.1
```

#### Banner Current

```
`Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module.
Get-JCEvent and Get-JCEventCount functions now work with MTP API Keys.
Get-JCUser and Get-JCSystem date parameter is now datetime instead of string
```

#### Banner Old
Expand Down
17 changes: 17 additions & 0 deletions PowerShell/ModuleChangelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 1.18.1

Release Date: August 14, 2020

#### RELEASE NOTES

* `Get-JCUser` and `Get-JCSystem` updated to accept dates as a `datetime` type.
* Prevents "String not recognized as valid datetime" error in other non en-US regions

#### FEATURES:

#### IMPROVEMENTS:

#### BUG FIXES:

Dates in Get-JCuser and Get-JCSystem are now passed in as datetime types which prevents localization conversion errors

## 1.18.0

Release Date: August 13, 2020
Expand Down

0 comments on commit 4cc9bf0

Please sign in to comment.