Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-PVLogonFile parse error, expecting `';'' if PV_Configuration.xml already exists #75

Open
InconstantRO opened this issue Dec 16, 2022 · 0 comments

Comments

@InconstantRO
Copy link

Your issue may already be reported. Please search existing issues before creating one.

Your Environment

  • PowerShell Version: 5.1
  • PoShPACLI Version: 2.1.27
  • PACLI Version: 12.2.0.70
  • CyberArk Version: 12.2.4

Expected Behaviour

New-PVLogonFile should create new logon file

Current Behaviour

I receive an error:
parse error, expecting `';'

Possible Solution

Replace
$Null = Invoke-PACLICommand $Script:PV.ClientPath CREATELOGONFILE $($PSBoundParameters | ConvertTo-ParameterString)
With
$Null = Invoke-PACLICommand $Script:PV.ClientPath CREATELOGONFILE $($PSBoundParameters | ConvertTo-ParameterString -NoVault -NoUser)
In New-PVLogonFile.ps1 file

Steps to Reproduce (for bug reports)

  1. Pre-generate PV_Configuration.xml file, by running PACLI logon normally. Example commands to be run to generate that file:
    Set-PVConfiguration -ClientPath $pacliPath
    Start-PVPacli -sessionID $sessionID
    New-PVVaultDefinition -vault $vaultName -address $vaultAddress
    Connect-PVVault -user $creds.UserName -password $creds.Password
    Disconnect-PVVault
    Stop-PVPacli
  2. Try to run commands below again, once PV_Configuration.xml file already exists, and you'll get an error
    Set-PVConfiguration -ClientPath $pacliPath
    Start-PVPacli -sessionID $sessionID
    New-PVLogonFile -logonFile $Global:hash.pacliLogonFilePath -username $creds.UserName -password $creds.Password

I think the problem is that CREATELOGONFILE doesn't accept vault and user attributes, but when PV_Configuration.xml is already pre-created, script is using params from old file.

Context

I'm trying to generate new logon file to be used later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant