mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
win_shortcut: Add hotkeys examples to documentation (#30694)
This fixes #29110
This commit is contained in:
parent
cca4f94736
commit
13bc5314ce
2 changed files with 19 additions and 48 deletions
|
@ -1,29 +1,15 @@
|
||||||
#!powershell
|
#!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
|
# Copyright: (c) 2016, Dag Wieers (@dagwieers) <dag@wieers.com>
|
||||||
# POWERSHELL_COMMON
|
# 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/
|
# Based on: http://powershellblogger.com/2016/01/create-shortcuts-lnk-or-url-files-with-powershell/
|
||||||
|
|
||||||
|
#Requires -Module Ansible.ModuleUtils.Legacy.psm1
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$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
|
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false
|
||||||
|
|
||||||
$orig_src = Get-AnsibleParam -obj $params -name "src"
|
$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
|
#!/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# (c) 2016, Dag Wieers <dag@wieers.com>
|
# 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)
|
||||||
# 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/>.
|
|
||||||
|
|
||||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
'status': ['preview'],
|
'status': ['preview'],
|
||||||
'supported_by': 'community'}
|
'supported_by': 'community'}
|
||||||
|
|
||||||
|
DOCUMENTATION = r'''
|
||||||
DOCUMENTATION = '''
|
|
||||||
---
|
---
|
||||||
module: win_shortcut
|
module: win_shortcut
|
||||||
version_added: '2.3'
|
version_added: '2.3'
|
||||||
|
@ -59,20 +44,18 @@ options:
|
||||||
hotkey:
|
hotkey:
|
||||||
description:
|
description:
|
||||||
- Key combination for the shortcut.
|
- 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:
|
windowstyle:
|
||||||
description:
|
description:
|
||||||
- Influences how the application is displayed when it is launched.
|
- Influences how the application is displayed when it is launched.
|
||||||
choices:
|
choices: [ maximized, minimized, normal ]
|
||||||
- maximized
|
|
||||||
- minimized
|
|
||||||
- normal
|
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- When C(present), creates or updates the shortcut. When C(absent),
|
- When C(present), creates or updates the shortcut.
|
||||||
removes the shortcut if it exists.
|
- When C(absent), removes the shortcut if it exists.
|
||||||
choices:
|
choices: [ absent, present ]
|
||||||
- absent
|
|
||||||
- present
|
|
||||||
default: present
|
default: present
|
||||||
author:
|
author:
|
||||||
- Dag Wieers (@dagwieers)
|
- Dag Wieers (@dagwieers)
|
||||||
|
@ -95,6 +78,7 @@ EXAMPLES = r'''
|
||||||
dest: '%Public%\Desktop\Mozilla Firefox.lnk'
|
dest: '%Public%\Desktop\Mozilla Firefox.lnk'
|
||||||
icon: '%ProgramFiles\Mozilla Firefox\Firefox.exe,0'
|
icon: '%ProgramFiles\Mozilla Firefox\Firefox.exe,0'
|
||||||
directory: '%ProgramFiles%\Mozilla Firefox'
|
directory: '%ProgramFiles%\Mozilla Firefox'
|
||||||
|
hotkey: Ctrl+Alt+F
|
||||||
|
|
||||||
- name: Create an application shortcut for an executable in PATH to your desktop
|
- name: Create an application shortcut for an executable in PATH to your desktop
|
||||||
win_shortcut:
|
win_shortcut:
|
||||||
|
@ -108,6 +92,7 @@ EXAMPLES = r'''
|
||||||
args: --new-window https://ansible.com/
|
args: --new-window https://ansible.com/
|
||||||
directory: '%ProgramFiles%\Google\Chrome\Application'
|
directory: '%ProgramFiles%\Google\Chrome\Application'
|
||||||
icon: '%ProgramFiles%\Google\Chrome\Application\chrome.exe,0'
|
icon: '%ProgramFiles%\Google\Chrome\Application\chrome.exe,0'
|
||||||
|
hotkey: Ctrl+Alt+A
|
||||||
|
|
||||||
- name: Create a URL shortcut for the Ansible website
|
- name: Create a URL shortcut for the Ansible website
|
||||||
win_shortcut:
|
win_shortcut:
|
||||||
|
@ -115,5 +100,5 @@ EXAMPLES = r'''
|
||||||
dest: '%Public%\Desktop\Ansible website.url'
|
dest: '%Public%\Desktop\Ansible website.url'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r'''
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in a new issue