Comments (10)
@smurawski I'm just testing mwf 5.1 on windows 6.1 and found a nasty bug after powershell 5.1 was installed on windows 7 sp1 (doesn't testing 2008r2 yet).
Default Powershell Configuration Session, Microsoft.powershell has been unregistered and there is only Microsoft.powershell.workflow registered.
And therefore test-kitchen can't connect after succefully converge and reboot as WinRM doesn't accept connections.
As a workaround
# NOTE: add hotfix to Microsoft.powershell bug after WMF5.1 installation
# as Test-Kitchen couldn't connect via WinRM after reboot
if ENV['TEST_KITCHEN']
registry_key 'HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce' do
values [
{ name: '!FixPowershell5', type: :string, data: "C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -ExecutionPolicy Bypass -NonInteractive -Command \"sleep 120; Register-PSSessionConfiguration -Name Microsoft.powershell -Force\"" },
]
only_if { powershell_out("$PSVersionTable.PSVersion.Major").stdout.strip.to_i < 5 }
action :create
end
end
# ensure Microsoft.powershell is enabled after WMF5.1 installation
powershell_script 'Register Microsoft.powershell session configuration' do
code 'Register-PSSessionConfiguration -Name Microsoft.powershell -Force'
not_if '(Get-PSSessionConfiguration -Name microsoft.powershell) -ne $null'
action :run
end
include_recipe 'ms_dotnet::ms_dotnet4'
include_recipe 'powershell::powershell5'
from powershell.
There's work progress on this cookbook (and some of it's dependencies) in prep for Chef 13. We can remove wmf 5 support and update to wmf 5.1 as part of that process.
from powershell.
I'm working on this now.
from powershell.
@tas50 what do you think about this? I can start WIP PR for wmf5.1.
from powershell.
As per today announcement https://blogs.msdn.microsoft.com/powershell/2017/03/28/windows-management-framework-wmf-5-1-now-in-microsoft-update-catalog/ WMF5.0 will be removed from Download Center as of June 1, 2017.
As previously announced, WMF 5.1 is a required update for WMF 5.0, and may be installed directly over WMF 5.0. As of June 1, 2017, users with WMF 5.0 must upgrade to WMF 5.1 to receive support. At that time, WMF 5.0 will be removed from the Download Center and from the WSUS catalog.
I think we should deprecate wmf5.0 in powershell5
recipe until this time.
from powershell.
https://sysadminplus.blogspot.ru/2016/11/the-ws-management-service-cannot.html
from powershell.
Here we go
# NOTE: add hotfix to Microsoft.powershell bug after WMF5.1 installation
# as Test-Kitchen couldn't connect via WinRM after reboot
cmd = 'C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe'
cmd << " -NoProfile -Executionpolicy Bypass -NonInteractive -Command \"sleep 120;"
cmd << " Register-PSSessionConfiguration -Name Microsoft.powershell -Force\""
if ENV['TEST_KITCHEN']
registry_key 'HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce' do
values [
{ name: '!FixPowershell5', type: :string, data: cmd },
]
only_if { powershell_out('$PSVersionTable.PSVersion.Major').stdout.strip.to_i < 5 }
action :create
end
end
# ensure Microsoft.powershell is enabled after WMF5.1 installation
powershell_script 'Register Microsoft.powershell session configuration' do
code 'Register-PSSessionConfiguration -Name Microsoft.powershell -Force'
not_if '(Get-PSSessionConfiguration -Name microsoft.powershell) -ne $null'
not_if { powershell_out('$PSVersionTable.PSVersion.Major').stdout.strip.to_i < 5 }
action :run
end
include_recipe 'ms_dotnet::ms_dotnet4'
include_recipe 'powershell::powershell5'
To workaround Access denied
in WMF 2.0 when running Get-PSSessionConfiguration
under System
account I'm using second not_if guard
not_if { powershell_out('$PSVersionTable.PSVersion.Major').stdout.strip.to_i < 5 }
from powershell.
The support deadline for WMF 5.0 is a few days away (June 2017). Any news on WMF 5.1? Thanks.
from powershell.
@smurawski any progress on this issue? can i help with testing?
from powershell.
Sorry, I got hung up on some other stuff a while back. I'll start back up on this tomorrow and get a release out with 5.1.
from powershell.
Related Issues (20)
- Switch from windows_package to package resource to prevent warnings on each run HOT 3
- Name of module is not valid when installed with powershell_module HOT 2
- Kitchen Converge fails with PowerShell5 and Windows cookbook version 3.0.0 HOT 2
- powershell5 recipe error on 2008R2 HOT 3
- powershell5 upgrade exits with '5' HOT 3
- Files are not copied recursively for a locally-sourced PowerShell module HOT 2
- Setting ['installation_reboot_mode'] = 'immediate_reboot' should not stop Chef run HOT 1
- Install Powershell 6 support? HOT 2
- Add: Delay windows reboot HOT 3
- Deprecation messsages from windows cookbook
- Dependency Dashboard
- Fix CI tests
- powershell5 not installing... image file did not contain a resource section HOT 9
- Undefined node attribute or method `<' on `node' HOT 2
- Clarify use of installation recipes in the README HOT 1
- Failure to install WMF5
- (low pri) deprecated warning HOT 2
- Is there a way to suppress the reboot handler exception (via attribute?) HOT 5
- Powershell cookbook on the supermarket fails with the latest version of the windows cookbook
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powershell.