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

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

Closed
johlju opened this issue Nov 3, 2017 · 0 comments · Fixed by #898
Closed
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

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 johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Nov 3, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 3, 2017
- Changes to xSQLServerEndpointPermission
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue dsccommunity#897).
- Changes to xSQLServerAvailabilityGroupListener
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue dsccommunity#897).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 3, 2017
- Changes to xSQLServerEndpointPermission
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue dsccommunity#897).
- Changes to xSQLServerAvailabilityGroupListener
  - Fixed a problem when running the tests locally in a PowerShell console it
    would ask for parameters (issue dsccommunity#897).
johlju added a commit that referenced this issue Nov 4, 2017
- 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 The issue is being actively worked on by someone. 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
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant