fix PS type conversion failure when using "all" profiles (#34383)

* obscure type promotion issue in some versions of Powershell causes [int]::MaxValue to be promoted to [int64] when doing a COM property get or set. Since the "All" profiles value of 0x7FFFFFFF is [int]::MaxValue, it would trigger "Specified cast is not valid" when modifying a rule that's already set to All Profiles or trying to be.
* Fixed catch-all error handler to include exception detail
* Added test converage for this case
This commit is contained in:
Matt Davis
2018-01-02 20:25:46 -08:00
committed by GitHub
parent 136d902ff3
commit 206b6ebe0d
2 changed files with 30 additions and 3 deletions

View File

@@ -360,6 +360,23 @@
that:
- add_firewall_rule_with_string_profiles.changed == true
- name: Set firewall rule profile back to 'all'
win_firewall_rule:
name: http
enabled: yes
state: present
localport: 80
action: allow
direction: in
protocol: tcp
profiles: [Domain, Public, Private]
register: add_firewall_rule_with_string_profiles
- name: Check that setting firewall rule profile back to 'all' succeeds with a change
assert:
that:
- add_firewall_rule_with_string_profiles.changed == true
- name: Add firewall rule with profiles in list format
win_firewall_rule:
name: http