windows-feature('NET-Framework-Core') not seen as installed


#1

I am writing a cookbook to setup a web server. On the recipe side the windows feature is being installed/verified using DSC using:

# Ensure .NET 2.0, 3.0, 3.5 is installed
dsc_script 'DotNET-Framework' do
  code <<-EOH
  WindowsFeature InstallDotNetFramework
  {
    Name = 'NET-Framework-Core'
    Ensure = 'Present'
  }
  EOH
end

I can log in to the test kitchen server after converge and verify that ‘NET-Framework-Core’ is in fact installed. When I run a kitchen verify Inspec tells me that it is not installed.

Inspec comand:

# .NET 3.5, 3.0 and 2.0 Framework installed
describe windows_feature('NET-Framework-Core') do
  it { should be_inistalled }
end

Error from console:

:heavy_multiplication_x: ‘NET-Framework-Core’ should be inistalled
expected Windows Feature ‘NET-Framework-Core’ to respond to inistalled?

Just in case a gist of the kitchen log is here: https://gist.github.com/brettski/6ff7c42f58e45987af680747ae9c112b
And a gist of the installed feature list from the server: https://gist.github.com/brettski/06e77d7d08294a2e6016f870cfc6f541

I am confused on why the feature is not seen as being installed when I know that it is. The error in the Kitchen log isn’t much help to me. Any suggestions are greatly appreciated.


#2

In your inspec, you have a typo.

Try be_installed not be_inistalled.

Thanks

Andrew


#3

@Brettski Thank you for posting the question. Here is a version that works on my machine:

describe windows_feature('NET-Framework-Core') do
  it { should be_installed }
end

describe windows_feature('NET-Framework-45-Core') do
  it { should be_installed }
end

This results in:

You can always double-check the result with Get-WindowsFeature Cmdlet:


#4

DOH! Very good and thank you. I would be nice of such a thing was picked up by a linter.