mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 02:30:22 -07:00
powershell: Respect remote_tmp path set by the user (#40210)
* powershell: Respect remote_tmp path set by the user * Fixed up linting error and typo * Added changelog
This commit is contained in:
parent
070a5557d1
commit
f84f3de7c2
18 changed files with 281 additions and 203 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
$params = Parse-Args -arguments $args -supports_check_mode $true
|
||||
$check_mode = Get-AnsibleParam -obj $params "_ansible_check_mode" -type 'bool' -default $false
|
||||
$_remote_tmp = Get-AnsibleParam $params "_ansible_remote_tmp" -type "path" -default $env:TMP
|
||||
|
||||
$location = Get-AnsibleParam -obj $params -name 'location' -type 'str'
|
||||
$format = Get-AnsibleParam -obj $params -name 'format' -type 'str'
|
||||
|
@ -98,7 +99,14 @@ Function Copy-RegistryKey($source, $target) {
|
|||
Function Set-CultureLegacy($culture) {
|
||||
# For when Set-Culture is not available (Pre Windows 8 and Server 2012)
|
||||
$reg_key = 'HKCU:\Control Panel\International'
|
||||
|
||||
$original_tmp = $env:TMP
|
||||
$original_temp = $env:TEMP
|
||||
$env:TMP = $_remote_tmp
|
||||
$env:TEMP = $_remote_tmp
|
||||
Add-Type -TypeDefinition $lctype_util
|
||||
$env:TMP = $original_tmp
|
||||
$env:TEMP = $original_temp
|
||||
|
||||
$lookup = New-Object Ansible.LocaleHelper($culture)
|
||||
# hex values are from http://www.pinvoke.net/default.aspx/kernel32/GetLocaleInfoEx.html
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue