Trimming

19 views
Skip to first unread message

Suporter

unread,
Feb 5, 2018, 5:27:15 AM2/5/18
to Ansible Project
hi,
 i have a variable registered as Location and the value is C:\Windows\System32, i want to modify it to C:\windows\felik , i would like to modify the location upto drive level wherever required.. how can i do this

J Hawkesworth

unread,
Feb 5, 2018, 10:04:59 AM2/5/18
to Ansible Project
You can probably use the win_splitdrive filter to get the drive letter from the path


You may also perhaps find using the SystemDrive and SystemRoot environment variables contain what you need.

The following powershell will return the system root, for example

echo $env:SystemRoot



Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages