And to change it from querying “name” to “MainWindowTitle” property - the custom application this would be for uses this property to describe if a user is logged in or not.
When using the module win_lineinfile on a file that contains information we could use to check if a user is logged in to a specific application we get an access denied. The important point is that the application only writes changes to the file when a user logs in or logs out, it has an active handle on the file in-between but doesn’t write any information. Would “become” help with this?
The Windows Module in github that are present as python version, are they only a documentation stub or do they server another purpose? When writing custom Windows modules, is it sufficient to have them written in PowerShell or is there any benefit in having a Python version, too?
I have a few short questions around the Windows Module.
1. Is it allowed (as per the GNU license) to also customize the existing
Windows Modules or only add new ones?
Taking legal advice from a random dude on the Internet is a disaster waiting to happen.
You should read the license[1] or check out the quick guide[2].
2. When using the module win_lineinfile on a file that contains information
we could use to check if a user is logged in to a specific application we
get an access denied. The important point is that the application only
writes changes to the file when a user logs in or logs out, it has an
active handle on the file in-between but doesn't write any information.
Would "become" help with this?
Why don't you try I see if it works?
Probably the easiest and fastest solution to get the answer.
(I don't do Windows so I have no idea)
Is it allowed (as per the GNU license) to also customize the existing Windows Modules or only add new ones?
Please note I am not an IP lawyer so I recommend you talk to your company’s legal team if you actually want legal advice.
Of course, any community member can make changes to the modules through a PR. You cannot change the license for certain bits of code but if you want to fix a bug, add a new feature, or something else, you can raise a PR right now.
When using the module win_lineinfile on a file that contains information we could use to check if a user is logged in to a specific application we get an access denied. The important point is that the application only writes changes to the file when a user logs in or logs out, it has an active handle on the file in-between but doesn’t write any information. Would “become” help with this?
Probably not, if a thread has an open handle to a file and does not allow other reads or writes then there’s nothing you can do. Each handle is per thread and not per logon session so even the same user in the same logon session wouldn’t be able to open a new handle to that file. This all happens quite deep within Windows and the file is “locked” until that handle is closed, or you change the code that opens the handle to allow more sharing options.
The Windows Module in github that are present as python version, are they only a documentation stub or do they server another purpose? When writing custom Windows modules, is it sufficient to have them written in PowerShell or is there any benefit in having a Python version, too?
Yep, we have a .py equivalent file for each Windows module and it’s purely for documentation purposes. We parse these files and generate our online docs so that’s why we have kept them the same. Right now if you want to write a module for Windows it needs to be in PowerShell. You cannot run Python modules on Windows, or at least use a Python module with our shared utils on Windows.