mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
Win_hostname module: Change name check to WMI (#56420)
* Change name check to WMI * Changelog fragment * Fixed per review
This commit is contained in:
parent
35c8739c2a
commit
94566ed79c
2 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,8 @@ $params = Parse-Args $args -supports_check_mode $true
|
|||
$name = Get-AnsibleParam -obj $params -name "name" -type "str" -failifempty $true
|
||||
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false
|
||||
|
||||
$current_computer_name = $env:ComputerName
|
||||
$current_computer_name = (Get-CimInstance -Class Win32_ComputerSystem).DNSHostname
|
||||
|
||||
$result = @{
|
||||
changed = $false
|
||||
old_name = $current_computer_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue