win_shortcut: Add hotkeys examples to documentation (#30694)

This fixes #29110
pull/30721/head
Dag Wieers 7 years ago committed by Jordan Borean
parent cca4f94736
commit 13bc5314ce

@ -1,29 +1,15 @@
#!powershell
# (c) 2016, Dag Wieers <dag@wieers.com>
#
# 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/>.
# WANT_JSON
# POWERSHELL_COMMON
# Copyright: (c) 2016, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Based on: http://powershellblogger.com/2016/01/create-shortcuts-lnk-or-url-files-with-powershell/
#Requires -Module Ansible.ModuleUtils.Legacy.psm1
$ErrorActionPreference = "Stop"
$params = Parse-Args $args -supports_check_mode $true
$params = Parse-Args -arguments $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false
$orig_src = Get-AnsibleParam -obj $params -name "src"
@ -149,4 +135,4 @@ If ($state -eq "absent") {
}
}
Exit-Json $result
Exit-Json -obj $result

@ -1,29 +1,14 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Dag Wieers <dag@wieers.com>
#
# 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) 2016, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: win_shortcut
version_added: '2.3'
@ -59,20 +44,18 @@ options:
hotkey:
description:
- Key combination for the shortcut.
- This is a combination of one or more modifiers and a key.
- Possible modifiers are Alt, Ctrl, Shift, Ext.
- Possible keys are [A-Z] and [0-9].
windowstyle:
description:
- Influences how the application is displayed when it is launched.
choices:
- maximized
- minimized
- normal
choices: [ maximized, minimized, normal ]
state:
description:
- When C(present), creates or updates the shortcut. When C(absent),
removes the shortcut if it exists.
choices:
- absent
- present
- When C(present), creates or updates the shortcut.
- When C(absent), removes the shortcut if it exists.
choices: [ absent, present ]
default: present
author:
- Dag Wieers (@dagwieers)
@ -95,6 +78,7 @@ EXAMPLES = r'''
dest: '%Public%\Desktop\Mozilla Firefox.lnk'
icon: '%ProgramFiles\Mozilla Firefox\Firefox.exe,0'
directory: '%ProgramFiles%\Mozilla Firefox'
hotkey: Ctrl+Alt+F
- name: Create an application shortcut for an executable in PATH to your desktop
win_shortcut:
@ -108,6 +92,7 @@ EXAMPLES = r'''
args: --new-window https://ansible.com/
directory: '%ProgramFiles%\Google\Chrome\Application'
icon: '%ProgramFiles%\Google\Chrome\Application\chrome.exe,0'
hotkey: Ctrl+Alt+A
- name: Create a URL shortcut for the Ansible website
win_shortcut:
@ -115,5 +100,5 @@ EXAMPLES = r'''
dest: '%Public%\Desktop\Ansible website.url'
'''
RETURN = '''
RETURN = r'''
'''

Loading…
Cancel
Save