4 ms·
Forgive me if I'm speaking completely in erro, but doesn't Powershell allow the latter, by exposing every Windows API known to man?
by SuperNinKenDo 3y ago
Forgive me if I'm speaking completely in erro, but doesn't Powershell allow the latter, by exposing every Windows API known to man?
- pxc 3y agoSome settings changes happen are effected via undocumented registry changes that you have to make directly, and can be a pain to track down. Sometimes you can do something via PowerShell, but only by using PowerShell to directly call some 'raw' .NET API. Sometimes there's a native CLI utility that'll do what you want, but it's one of the DOS-like, pre-PowerShell commands, and the PowerShell equivalent is missing or unsuitable. Even when a native PowerShell API exists, it can be difficult to find the documentation for it because Windows culture is to document GUI solutions first (and often GUI solutions only). Try as one might, Windows remains a platform inherently hostile to automation. Doing automation and/or configuration management on Windows sucks.
- Meph504 3y agopowershell doesn't expose everything by default, there are insane numbers of modules that are community created though.
- yourusername 3y agoWhat can't you access through a combination of wmi and pinvoke?
- tonyedgecombe 3y agoI used to use wmi in my software to manage printer ports. In the end I had to remove it because wmi was broken on a significant number of my customers machines.
- jborean93 3y agoYou can, it’s just that going the PInvoke route can be quite complicated. It can certainly be done but typically finding a good community module that has already done so makes things a lot easier.