title: Install .Net Framework 4.6.1 using Ansible
body: <p>I'm trying to install .Net Framework 4.6.1 using Ansible but until now I have no luck.</p>
  
  <p>I've tried those methods:</p>
  
  <ol>
  <li><p>Running a win_package to install it, but it just hangs till infinity</p>
  
  <pre><code>- name: Install Microsoft NET Framework
    win_package:
      path: "http://path/to/dotNetFramework4.6.1.exe"
      product_id: '{BD6F5371-DAC1-30F0-9DDE-CAC6791E28C3}'
      register: dotnetfx_exe
  </code></pre></li>
  <li><p>Run a PowerShell script to install it (first doesn't work and second throws stack-overflow exception):</p>
  
  <pre><code>Install-WindowsFeature Net-Framework-Core -source C:\temp\dotNetFramework4.6.1.exe
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>Start-Process -FilePath C:\temp\dotNetFramework4.6.1.exe -ArgumentList "/q /norestart" -Wait -Verb RunAs
  </code></pre></li>
  <li><p>I've tried to use win_feature to install it, but it just do nothing.</p>
  
  <pre><code>- name: Install NET-Framework-Core
    win_feature:
      name: NET-Framework-Core
      state: present
      source: C:\temp\dotNetFramework4.6.1.exe
      include_sub_features: no
      include_management_tools: yes
    register: result
  </code></pre></li>
  <li><p>Tried to run a batch script to install it, but no luck:</p>
  
  <pre><code>start /wait c:\temp\dotNetFramework4.6.1.exe /q /norestart /log %TEMP%\dotNetFx4.6.1.log
  </code></pre></li>
  </ol>
  
  <p>Has anyone succeeded installing .Net Framework 4.6.1 using Ansible?</p>
  
  <p>Could anyone share their task/role that installs it?</p>