mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
windows: removed deprecated features in 2.6 (#38930)
* windows: removed deprecated features in 2.6 * Comma surgery.
This commit is contained in:
parent
8d77c6cc16
commit
f8853d83e3
15 changed files with 32 additions and 197 deletions
|
@ -1,24 +1,10 @@
|
|||
#!powershell
|
||||
|
||||
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
|
||||
# Copyright: (c) 2017, Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
#Requires -Module Ansible.ModuleUtils.Legacy
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
|
@ -51,12 +37,7 @@ if ($input_attributes) {
|
|||
# Uses dict style parameters, newer and recommended style
|
||||
$attributes = $input_attributes
|
||||
} else {
|
||||
# Uses older style of separating with | per key pair and : for key:value (paramA:valueA|paramB:valueB)
|
||||
Add-DeprecationWarning -obj $result -message "Using a string for the attributes parameter is deprecated, please use a dict instead" -version 2.6
|
||||
$input_attributes -split '\|' | ForEach-Object {
|
||||
$key, $value = $_ -split "\:"
|
||||
$attributes.$key = $value
|
||||
}
|
||||
Fail-Json -obj $result -message "Using a string for the attributes parameter is not longer supported, please use a dict instead"
|
||||
}
|
||||
}
|
||||
$result.attributes = $attributes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue