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

xSQLServer: Running tests locally in PowerShell console generates prompt for parameters #897

Closed
johlju opened this Issue Nov 3, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@johlju
Contributor

johlju commented Nov 3, 2017

Details of the scenario you tried and the problem that is occurring:
This block is the problem in the below code. Before this block $testParameters contains 4 keys (InstanceName, etc). Instead of adding two more keys, this block of code changes the $testParameters to only contain these two keys (Ensure, Permission). But why it do work in the debugger and not in the PowerShell prompt is a mystery. 😄

$testParameters += @{
    Ensure = 'Present'
    Permission = 'CONNECT'
}

Changing the block to this resolves the problem.

$testParameters['Ensure'] = 'Present'
$testParameters['Permission'] = 'CONNECT'

https://github.com/PowerShell/xSQLServer/blob/61862e73f3bc4067e1217f42e04d761bf96a19b7/Tests/Unit/MSFT_xSQLServerEndpointPermission.Tests.ps1#L171-L205

The DSC configuration that is using the resource (as detailed as possible):
n/a

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows 10.
PS > $PSVersionTable

Name Value


PSVersion 5.1.17025.1000
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17025.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
n/a

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 3, 2017

Changes to xSQLServer
- Changes to xSQLServerEndpointPermission
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue PowerShell#897).
- Changes to xSQLServerAvailabilityGroupListener
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue PowerShell#897).

johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 3, 2017

Changes to xSQLServer
- Changes to xSQLServerEndpointPermission
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue PowerShell#897).
- Changes to xSQLServerAvailabilityGroupListener
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue PowerShell#897).

@johlju johlju closed this in #898 Nov 4, 2017

johlju added a commit that referenced this issue Nov 4, 2017

xSQLServer: Fix running tests locally in PowerShell console (#898)
- Changes to xSQLServerEndpointPermission
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue #897).
- Changes to xSQLServerAvailabilityGroupListener
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue #897).

@johlju johlju removed the in progress label Nov 4, 2017

@johlju johlju removed their assignment Nov 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment