mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
win_wakeonlan: Fix pslint issues (#37717)
This commit is contained in:
parent
c73ee8aac8
commit
f78b415db0
2 changed files with 6 additions and 20 deletions
|
@ -1,23 +1,10 @@
|
|||
#!powershell
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# (c) 2017, Dag Wieers <dag@wieers.com>
|
||||
#
|
||||
# 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/>.
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
#Requires -Module Ansible.ModuleUtils.Legacy
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
|
@ -47,7 +34,7 @@ if ($mac.Length -ne 12) {
|
|||
|
||||
# Create payload for magic packet
|
||||
# TODO: Catch possible conversion errors
|
||||
$target = 0,2,4,6,8,10 | % { [convert]::ToByte($mac.Substring($_, 2), 16) }
|
||||
$target = 0,2,4,6,8,10 | ForEach-Object { [convert]::ToByte($mac.Substring($_, 2), 16) }
|
||||
$data = (,[byte]255 * 6) + ($target * 20)
|
||||
|
||||
# Broadcast payload to network
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue