Giter Club home page Giter Club logo

jcapi-powershell's People

Contributors

btstevens avatar epanipinto avatar gweinjc avatar jc-rbacon avatar jworkmanjc avatar kmoorehead-jc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jcapi-powershell's Issues

Regression: jumpcloud 2.1.0 powershell module fails to import function Get-JCObject.ps1

Describe the bug
Importing the Jumpcloud version 2.1.0 powershell module fails when attempting to import Get-JCObject.ps1 function. Importing Jumpcloud version 2.0.2 module works without error therefore this seems like a serious regression.

To Reproduce

  1. Install Jumpcloud: Install-Module -Name JumpCloud -Force
  2. Import Jumpcloud module: Import-Module -Name JumpCloud -Force

Steps to reproduce the behavior:

Expected behavior
No Errors

Actual behavior

PS C:\scripts> Install-Module -Name JumpCloud -Force

PS C:\scripts> Import-Module -Name JumpCloud -Force
C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\JumpCloud.psm1 : Failed to import function C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1: At
C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:213 char:71
+ ...              $result = $result | Where-Object { $_ –ne $dirResult }
+                                                        ~~~~~~~~~~~~~~~~~~
Unexpected token '–ne $dirResult }
                            }
                        }
                    }
                    # Validate results
                    If ($Result -and $Result.PSObject.Properties.name -notcontains 'NoContent') {
                        If ($SearchBy -and ($Result | Measure-Object).Count -gt 1) {
                            Write-Warning -Message:('Found "' + [string]($Result | Measure-Object).Count + '" "' + $JCType.TypeName.TypeNamePlural + '" with the "' + $SearchBy.Replace('By', '').ToLower() + '" of "'
+ $SearchByValueItem + '"')
                        }
                        $Results += $Result
                    } ElseIf ($SearchByValueItem) {
                        Write-Warning ('A "' + $JCType.TypeName.TypeNameSingular + '" called "' + $SearchByValueItem + '" does not exist. Note the search is case sensitive.')
                    } Else {
                        Write-Warning ('The search value is blank or no "' + $JCType.TypeName.TypeNamePlural + '" have been setup in your org. SearchValue:"' + $SearchByValueItem + '"')
                    }
                }
                # Re-lookup object by id
                If ($Results -and $SearchBy -eq 'ByName' -and $JCType.TypeName.TypeNameSingular -notin ('g_suite', 'office_365')) {
                    # Hacky logic to get g_suite and office_365 directories
                    $PsBoundParameters.Remove('Name') | Out-Null
                    $PsBoundParameters.Remove('SearchBy') | Out-Null
                    $PsBoundParameters.Remove('SearchByValue') | Out-Null
                    $PsBoundParameters.Add('Id', $Results.($JCType.ById)) | Out-Null
                    $Results = Get-JCObject @PsBoundParameters
                } Else {
                    If ($Results) {
                        Write-Verbose "Results' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:271 char:54
+ ...  + $Type + '" not found. $Type must be:' + ($JCType.TypeName.TypeName ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: ".
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:213 char:66
+ ...                            $result = $result | Where-Object { $_ –n ...
+                                                                 ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:212 char:36
+                             } else {
+                                    ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:208 char:57
+                         foreach ($dirResult in $Result) {
+                                                         ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:197 char:90
+ ... f ($JCType.TypeName.TypeNameSingular -in ('g_suite', 'office_365')) {
+                                                                         ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:137 char:50
+                 ForEach ($UrlItem In $UrlObject) {
+                                                  ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:27 char:26
+             If ($JCType) {
+                          ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:26 char:13
+         Try {
+             ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\JumpCloud\2.1.0\Private\NestedFunctions\Get-JCObject.ps1:280 char:2
+ }
+  ~
The Try statement is missing its Catch or Finally block.
Not all parse errors were reported.  Correct the reported errors and try again.
At line:1 char:1
+ Import-Module -Name JumpCloud -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,JumpCloud.psm1

WARNING: The installed version of PowerShell does not support Parallel functionality. Consider updating to PowerShell 7 to use this feature.
WARNING: Visit aka.ms/powershell-release?tag=stable for latest release

System Device (please complete the following information):

  • OS: Windows Server 2019 Datacenter (AWS EC2 instance)
  • Version: 1809
  • OS build: 17763.1457

Additional context
Importing ver 2.0.2 works without error..

  1. Install Jumpcloud: Install-Module -Name JumpCloud -MaximumVersion 2.0.2 -Force
  2. Import Jumpcloud module: Import-Module -Name JumpCloud -Force
PS C:\scripts> Uninstall-Module -Name JumpCloud -Force

PS C:\scripts> Install-Module -Name JumpCloud -MaximumVersion 2.0.2 -Force

PS C:\scripts> Import-Module -Name JumpCloud -Force
WARNING: The installed version of PowerShell does not support Parallel functionality. Consider updating to PowerShell 7 to use this feature.
WARNING: Visit aka.ms/powershell-release?tag=stable for latest release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.