Skip to content

Commit

Permalink
Merge pull request #238 from TheJumpCloud/JumpCloudModule_1.17.3
Browse files Browse the repository at this point in the history
Jump cloud module 1.17.3
  • Loading branch information
Elliott Panipinto authored Jun 25, 2020
2 parents 5bfb0c4 + c1f6037 commit ded01ce
Show file tree
Hide file tree
Showing 97 changed files with 3,042 additions and 5,216 deletions.
4 changes: 0 additions & 4 deletions PowerShell/Deploy/Execute-GitCommit.ps1

This file was deleted.

18 changes: 0 additions & 18 deletions PowerShell/Deploy/Functions/Invoke-GitCommit.ps1

This file was deleted.

38 changes: 38 additions & 0 deletions PowerShell/Deploy/Invoke-GitCommit.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)][ValidateNotNullOrEmpty()][string]$BranchName
)
If ($BranchName -like 'refs/*/merge')
{
Write-Warning ('Skipping commit because branch matched "merge": ' + $BranchName)
}
Else
{
#Logging
$CommitMessage = 'Push to ' + $BranchName + ';[skip ci]'
$UserEmail = '[email protected]'
$UserName = 'AzurePipelines'
Function Invoke-Git
{
Param($Arguments)
If ([environment]::OSVersion.Platform -eq 'Win32NT') { $env:GIT_REDIRECT_STDERR = '2>&1' }
$LASTEXITCODE = 0
$Error.Clear()
$Command = 'git ' + $Arguments
Write-Host ('[GitCommand]' + $Command)
Invoke-Expression -Command:($Command)
If ($LASTEXITCODE)
{
Throw ('Git error, $LASTEXITCODE: ' + $LASTEXITCODE)
}
If ($Error)
{
Throw ('Git error, $Error: ' + $Error)
}
}
Invoke-Git -Arguments:('config user.email "' + $UserEmail + '";')
Invoke-Git -Arguments:('config user.name "' + $UserName + '";')
Invoke-Git -Arguments:('add -A;')
Invoke-Git -Arguments:('status;')
Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";')
Invoke-Git -Arguments:('push origin HEAD:' + $BranchName + ';')
}
1 change: 1 addition & 0 deletions PowerShell/JumpCloud Module/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tests/*-TestResults.xml
10 changes: 5 additions & 5 deletions PowerShell/JumpCloud Module/Docs/Get-JCPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Get-JCPolicy [<CommonParameters>]

### ByID
```
Get-JCPolicy [-PolicyID] <String> [-ByID] [<CommonParameters>]
Get-JCPolicy [-PolicyID] <String[]> [-ByID] [<CommonParameters>]
```

### Name
```
Get-JCPolicy [-Name <String>] [<CommonParameters>]
Get-JCPolicy [-Name <String[]>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -75,7 +75,7 @@ Accept wildcard characters: False
The Name of the JumpCloud policy you wish to query.
```yaml
Type: System.String
Type: System.String[]
Parameter Sets: Name
Aliases:

Expand All @@ -90,7 +90,7 @@ Accept wildcard characters: False
The PolicyID of the JumpCloud policy you wish to query.
```yaml
Type: System.String
Type: System.String[]
Parameter Sets: ByID
Aliases: _id, id

Expand All @@ -106,7 +106,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS
### System.String
### System.String[]
## OUTPUTS
### System.Object
Expand Down
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ The SystemInsights table to query against.
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: battery, managed_policies, sip_config, alf, crashes, usb_devices, ie_extensions, launchd, shared_folders, shared_resources, user_ssh_keys, logged_in_users, shadow, sharing_preferences, user_groups, kernel_info, system_controls, uptime, etc_hosts, logical_drives, disk_info, bitlocker_info, patches, programs, apps, browser_plugins, chrome_extensions, disk_encryption, firefox_addons, groups, interface_addresses, mounts, os_version, safari_extensions, system_info, users, certificates, cups_destinations, interface_details, python_packages, registry, scheduled_tasks, services, startup_items
Accepted values: battery, managed_policies, sip_config, alf, crashes, usb_devices, ie_extensions, launchd, shared_folders, shared_resources, user_ssh_keys, logged_in_users, shadow, sharing_preferences, user_groups, kernel_info, system_controls, uptime, etc_hosts, logical_drives, disk_info, bitlocker_info, patches, programs, apps, browser_plugins, chrome_extensions, disk_encryption, firefox_addons, groups, interface_addresses, mounts, os_version, safari_extensions, system_info, users, certificates, cups_destinations, interface_details, python_packages, registry, scheduled_tasks, services, startup_items, authorized_keys, appcompat_shims, dns_resolvers, wifi_networks, wifi_status, connectivity, windows_security_products, alf_exceptions, alf_explicit_auths

Required: True
Position: Named
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: 5/19/2020
# Generated on: 6/25/2020
#

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

# Version number of this module.
ModuleVersion = '1.17.2'
ModuleVersion = '1.17.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
37 changes: 36 additions & 1 deletion PowerShell/JumpCloud Module/JumpCloud.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,42 @@ Foreach ($Import in @($Public + $Private))
# Set default values for function parameters
$PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = 'application/json; charset=utf-8'
$PSDefaultParameterValues['Invoke-WebRequest:ContentType'] = 'application/json; charset=utf-8'
# https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=netcore-3.1
# Required
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls, [System.Net.SecurityProtocolType]::Tls11, [System.Net.SecurityProtocolType]::Tls12
# Might help resolve misc. 500 status code issues
[System.Net.ServicePointManager]::DefaultConnectionLimit = 999999;
[System.Net.ServicePointManager]::MaxServicePointIdleTime = 600000;
[System.Net.ServicePointManager]::MaxServicePoints = 999999;
If ($PSVersionTable.PSEdition -eq 'Core')
{
$PSDefaultParameterValues['Invoke-RestMethod:SkipCertificateCheck'] = $true
$PSDefaultParameterValues['Invoke-RestMethod:SkipHeaderValidation'] = $true
$PSDefaultParameterValues['Invoke-RestMethod:MaximumRetryCount'] = 5
$PSDefaultParameterValues['Invoke-RestMethod:RetryIntervalSec'] = 5

$PSDefaultParameterValues['Invoke-WebRequest:SkipCertificateCheck'] = $true
$PSDefaultParameterValues['Invoke-WebRequest:SkipHeaderValidation'] = $true
$PSDefaultParameterValues['Invoke-WebRequest:MaximumRetryCount'] = 5
$PSDefaultParameterValues['Invoke-WebRequest:RetryIntervalSec'] = 5
}
Else
{
#Ignore SSL errors
Add-Type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
}
# Set function aliases
Set-Alias -Name:('New-JCAssociation') -Value:('Add-JCAssociation')
# Export module member
Export-ModuleMember -Function $Public.BaseName -Alias *
Export-ModuleMember -Function $Public.BaseName -Alias *
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Function Get-ModuleBanner
Param(
$ModuleBannerUrl = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleBanner.md'
)
# Update security protocol
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls, [System.Net.SecurityProtocolType]::Tls12
# Build output object
$OutputObject = New-Object -TypeName:('PSCustomObject')
# Define expected Headers to find
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Function Get-ModuleChangeLog
Param(
$ModuleChangeLogUrl = 'https://git.io/jc-pwsh-releasenotes'
)
# Update security protocol
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls, [System.Net.SecurityProtocolType]::Tls12
# Build output object
$OutputObject = @()
# Define expected Headers to find
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ Function Invoke-JCApi
}
# Run request
$UserAgent = Get-JCUserAgent
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Write-Verbose ('Connecting to: ' + $Uri)
# PowerShell 5 won't let you send a GET with a body.
If ($Method -eq 'GET')
Expand Down Expand Up @@ -211,13 +210,13 @@ Function Invoke-JCApi
{
# Append meta info to each result record
Get-Variable -Name:($HiddenProperties) |
ForEach-Object {
$Variable = $_
$Results |
ForEach-Object {
$Variable = $_
$Results |
ForEach-Object {
Add-Member -InputObject:($_) -MemberType:('NoteProperty') -Name:($Variable.Name) -Value:($Variable.Value)
}
Add-Member -InputObject:($_) -MemberType:('NoteProperty') -Name:($Variable.Name) -Value:($Variable.Value)
}
}
# Validate results properties returned
$Fields | ForEach-Object {
If ($_ -notin ($Results | ForEach-Object { $_.PSObject.Properties.Name } | Select-Object -Unique))
Expand Down
Loading

0 comments on commit ded01ce

Please sign in to comment.