5 ms·
Effectively, forget about desktop and cmd and only live in powershell. That is what I do - Posh is my operating system, it autostarts with Windows. In a several
by majkinetor 10y ago
Effectively, forget about desktop and cmd and only live in powershell. That is what I do - Posh is my operating system, it autostarts with Windows. In a several months you will be effective user, but to master it will still take years.
In this regard, few tips:
- Install apps via Chocolatey. If app is not there create a package and maintain it. AU framework makes it one time development event. See this report:
https://gist.github.com/majkinetor/a700c70b8847b29ebb1c918d47ee4eb1 https://gist.github.com/majkinetor/a700c70b8847b29ebb1c918d4...
- Your profile is very important. I use profile.d which can be reused easily on all your machines:
https://github.com/majkinetor/powershell_profile.d https://github.com/majkinetor/powershell_profile.d
- Use Powershell Gallery and modules in general. Make module or reusable component for everything. See my work here:
https://github.com/majkinetor/posh https://github.com/majkinetor/posh
- Make sure you use mandatory cli tools:
cinst conemu less peco sysinternals everything copyq
- Do not use junk GUI editors such as ISE. Visual Studio Code is way better if you have to. Sometimes is OK when debugging. I would suggest vim because speed is of great importance in shell world.
- Follow reddit community and ask questions there rather then on SO which is full of achievement biatches. Redditors will help you for free for the joy of sharing the knowledge.
- Use Github to store all your stuff. Also, in coorporation you can use NAS share to let anybody import stuff from there.
- DO NOT LISTEN naysayers about aliases - use default alises all the time. They are cross-platform and well known and I can go into neurolinguistics of why is it better and easier for the brain but I don't want to do it here. People will certainly whine now but ignore them. DEFAULT (READ ONLY) ALIASES ARE THE BEST. Particularly, if you see somebody does foreach-object or where-object just kill him ASAP.
- Do ALL windows config from Posh. If you don't know ask around. If you are devops dude, you can thank me later, especially when you learn DSC and apply all that knowledge there or with boxstarter.
- If you happen to be locked in older posh use PSReadLine. Keep in mind that $host.Version -lt '3.0' is full of surprises and use latest version if possible.
- Do not compromise with others in coorporation. Ask for script for everything. If sysadmin tells you that server is low on disk you ask for proof in the form of the command you can execute. Ask for invoke-sql when using databases. If you give admin a job to create a IIS site for your web app ask for a script. If you are a project manager, do not close tickets without a script.
- If you monitor vendor excursions in your company infrastructure, ask for transcripipt of ALL operations they do. You will thank me later. Do not sign their work without it.
I can recommend "Windows Powershell In Depth"
https://www.manning.com/books/powershell-in-depth-second-edition https://www.manning.com/books/powershell-in-depth-second-edi...
And if you don't enjoy PS almost every single moment you are doing something wrong.
PS: I do not work for Microsoft :) I just think bash and friends are ridiculous in 2017 and honestly a little embarrassing. Do not do that - install Powershell on Linux and Mac if you have to and keep your sanity.
PS2: Somebody will certainly say that ruby/python/whatever is great on linux side. Ignore them. Those are not shell languages (while great otherwise and valuable in your skillset - cinst ruby python etc. is among my mandatory stuff but lets keep perspective here).
Good luck.
- fencepost 10y ago> Do not compromise with others in coorporation. Ask for script for everything. If sysamin tells you that your server is low on disk you ask for proof in the form of the command you can execute. If you give it a job to create a IIS site for you ask for a script. If you are a project manager like me, do not close tickets without a script. That may be the worst advice I've ever seen on how to work with others. It's the PowerShell equivalent of not just preaching veganism but requiring that anyone interacting with you start an organic garden.
- majkinetor 10y agoYou must be that click next person. I prefer to think about Posh as low carb, rather then veganism :) But more seriously, anything repeatable easily will do. The problem is, Posh is there on all Windows machines while everything else must be installed (except cmd.exe which should be forbiden IMO). I heave interactions with 100+ engineers of different domains and the only thing that links them is that they all use Windows, even 95% of Solaris/Unix/Linux admins. So Posh is the most practical thing. If you think reproducibility is bad thing or form of veganism, you should probably find another job.
- fencepost 10y agoReproducability is great. No, my concern is that if I submit a ticket that says "when I send 65 characters in the Username field I get random spew back, I think you need to be checking inputs better" and get a response of "show this to me with a PowerShell script" then I kick things upstairs with appropriate commentary. And if the attitude you related in these comments is accurate, I suspect those engineers all have something else in common: working to bypass you as much as possible.
- majkinetor 10y agoI think that start my-fancy-app.exe; Sleep; [System.Windows.Forms.SendKeys]::Send("A"*65) makes it way more reproducible and you even quickly get test from there (would do that in AutoHotkey tho for better effect, right tool for the job). > And if the attitude you related in these comments is accurate, I suspect those engineers all have something else in common: working to bypass you as much as possible. Actually, its quite the opposite. With that attitude tho, I suspect you get bypasses all the time.