Who here learning >powershell?

What books/resources are you using for it?

Attached: PowerShell_5.0_icon[1].png (256x256, 8K)

Other urls found in this thread:

docs.microsoft.com/en-us/powershell/
my.mixtape.moe/fphvrb.zip
msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx
msdn.microsoft.com/en-us/library/system.net.mail.smtpclient(v=vs.110).aspx
msdn.microsoft.com/en-us/library/system.xml.xmldocument(v=vs.110).aspx
msdn.microsoft.com/en-us/library/microsoft.win32(v=vs.110).aspx
msdn.microsoft.com/en-us/library/system.threading(v=vs.110).aspx
msdn.microsoft.com/en-us/library/system.configuration(v=vs.110).aspx
docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/creating-.net-and-com-objects--new-object-?view=powershell-6
msdn.microsoft.com/en-us/library/system.runtime.interopservices(v=vs.110).aspx
docs.microsoft.com/en-us/windows/desktop/cimwin32prov/win32-systemsystemdriver
twitter.com/SFWRedditImages

gay

CMD > MemeShell

Attached: Administrator CWindowssystem32cmd.exe.png (1037x642, 22K)

Lmfao you need a book to learn a command prompt? Jesus Christ IT people are retards

Im planning on going over a couple of books on the topic right after i finish the current book on using facebook

Most of the responses will be from faggots saying: “research it faggot”, “just google it, queer”, “you don’t know to ____, I bet you suck dick”

And eventually the thread will go completely off topic leaving you without any useful information.

I would start by watching YouTube vids. It sounds easy but watching what people do and having them explain the ‘whys’ will be useful. Get used to the syntax and the whole verb-noun thing.

For me, I stopped using any GUI and try to do the task using PS. Managing AD and Exchange is easier when you use PS to get things done.

Create a txt file to store any scripts you use. You can use that as a reference for any future scrips.

I literally cannot wrap my fucking brain around how the fuck ur supposed to understand what to write to achieve anything in powershell, the syntax style is literally anti-logic and only turboautism can even try and read it

This is exactly how I feel

docs.microsoft.com/en-us/powershell/

>to learn a command prompt
>calls others retards

>tfw no nerdy slightly low iq gf(male)
why not just store them as .ps1 so that you can run them?
unironically just play with it and search when you get stuck. never ever blindly copy and paste code - make a point of understanding exactly how it works so that you can do it again in future. also everything is an object with methods and properties which is quite an upgrade if you're coming from a batch or shell scripting background.
also make use of the powershell ise.

git bash exists

>
>>tfw no nerdy slightly low iq gf(male)
10 bux says the username in that shell is OPs chinese cartoon crush

I have bad news but you’re wrong for feeling this way. It’s all “objects”/data structures/methods. Most things return columnar data that you can parse however you want.

I am a Mac owner and a Linux admin and do not browse reddit.

That is not made clear in most tutorials FWIW but it’s true.

There is also tons of documentation and the ISE isn’t the worst thing they’ve invented. Don’t just use the prompt.

Why not learn a real shell?

>the syntax style is literally anti-logic and only turboautism can even try and read it

Powershell is miles more consistent than anything in unix shell. Commands follow the same naming conventions, the same argument syntax, output from commands doesn't require any regex mangling to pipe between commands, there are no stupid punctuation variables save for $_, it doesn't have the explosion of redundant bracket types or cryptic string parsing operators built in to bash, etc.

I can't think of a single thing sh/bash actually does better and there's no reason to pretend powershell isn't superior that doesn't involve mindelessly cargo-culting badly made old unix shit like what most of Jow Forums does.

Get-Help Whatever-Command

Well I won't waste time watching youtube videos or misunderstanding shit myself.

Just open ISE and play around with it, all the commands are shown and just wait to be clicked.
This is true, unix shell tools are retarded inconsistent outdated hell. God bless microsoft for porting PS to linux, I got so tired of doing trivial stuff in python.

Go away ruskie

I would rather learn bash.

>God bless microsoft for porting PS to linux
Shit I completely forgot about this and PS is one of the few things I actually miss from Windows. Thanks, user. Have a qt trap on me.

Attached: 1434206462828.jpg (600x800, 372K)

Get-Service | Where-Object {$_.Status –eq “Running”}

>too anti logic for grog
>grog angry
>grog lash out

Attached: confused-caveman[1].png (512x432, 217K)

|
|>
|
|3
|

idi back to kde gopnitsa, also ride my huj while you're at it

>single thing sh/bash actually does better
Being more concise which becomes important when used interactively.
For example, how do I get the the five largest png or jpg files in a folder with PS?
In bash it will be
ls -S +(*.jpg|*.gif) | head -n 5

it's consistent by virtue of being relatively modern without any legacy to hold onto and a lot of the benefits you list come from the fact that microsoft were the only ones using it save for the past couple of years
I'm not trying to defend bash or reduce the accomplishments of powershell but you're honestly a fool if you don't think the ecosystem is going to go to shit when everyone gets their grubby mitts all over it

Measure-Command { Get-ChildItem C:\ -Filter "*.txt" -Recurse }

Wow, so complicated and incomprehensible. I would much rather:

time find / -name "*.txt" 1>/dev/null 2>/dev/null

To get the same result, which roughly measures I/O performance.
But I don't remember if it will recurse. I think so. How do I make it non-recursive? Let's do "man find" and look for "recurse" because that's what it's called in "rm" and "cp". Pattern not found. So it is when you live in inconsistent hell, nothing new, let's recall synonyms. Something about "depth"? Oh right, we have a result:

-maxdepth levels
Descend at most levels (a non-negative integer) levels of directories below the starting-points.

So it's -maxdepth 1 to not recurse, because -maxdepth 0 will process only / itself. Gotta remember that!

s/gif/png/

Don't have PS handy to test, but probably something like:

Get-ChildItem . -Include *.jpg,*.png | Sort-Object Length -Descending | Select-String fullname -First 5

Can be made much shorter using aliases, but there's no reason to sacrifice readability to save literally 20 keystrokes.

time find *.txt
maybe learn the tools you use first

Missing the point.

source me up

MSYS2&zsh > MemeShell

Why does directory listing tool does the sorting by size? Isn't it the whole point of unix to use minimal sharpest tools that do just their job?

my.mixtape.moe/fphvrb.zip

Attached: unknown.png (745x125, 9K)

I ain't clicking that shit

>MSYS2&zsh
just use wsl you memer

Msys is only good for compiling native windows things with GCC

can use mkdir too

>my.mixtape.moe/fphvrb.zip
thanks

Well, I asked for it, so I will

>Yuliya
;)

np. trap threads are the only thing /b/ is good for and i'm always happy to share with a fellow man of culture

>there are no stupid punctuation variables save for $_,
>cryptic string parsing operators built in to bash
That's what AWK and sed are for :^)

Attached: Powershell.png (832x317, 11K)

>twf Powershit is a fancy batch

Attached: 1532998502117.jpg (200x200, 13K)

A lot of people will recommend the Month fo Lunches books, but the single best thing I did was google "Symantec Endpoint Protection manual uninstall," and write a powershell script that does that.

cbtnuggets course was okay

>object-oriented scripting language with easy access to .NET and pinvoke wizardry
>fancy batch

8/10 would mindlessly rush to MS's defense again

I fucking do everything in Powershell. From starting a service, to creating a UI, to making a bot.

I'll be at Powershell Saturday in Chattanooga Friday Saturday if anyone of you gtards are going.

>t. pajeet
just leave

>implying pajeets powershell
>implying pajeets don't instead shit out bloated, inflexible, half-broken C# to accomplish almost the same functionality

I honestly don't even know a pajeet that does powershell. The dudes doing it are all white too... So yes, I'll see myself out.

You pretty much can use it as C# without the debugger. I know this because I used it Powershell to patch together a bunch systems while putting random shit out of various databases at work. Never wanted to touch it again after that.

Attached: 1530398740812.jpg (773x721, 139K)

on that note, PS needs an official agnostic DB module. "Joe's MySQL" github project is hard to justify to my employers in production and I can't be arsed to invent that particular wheel.

What?

It's fucking verb>noun, it's easy as shit.
You can just search what you want to do,
>want to set dns sever
>get-command *set-dns*
>see command called set-dnsserver
>get-help set-dnsserver
>gives you an explanation of what it is, they required parameters, an example of how to you use it

How easy is that, you don;t even need to open a browser.

Attached: 1503336945540.png (724x286, 8K)

GNU's not Unix :^)

I grabbed some books off a russian site, helpful. My library has free access to Lynda tutorial, I watched some of that, that was really good as well

Get-ChildItem *.png, *.gif | select -First 5

This is the first thing that came to my mind.

Start with "learn Powershell in a month of lunches third edition" Then move on to "learn powershell toolmaking in a month of lunches third edition". If you do some googling you can find the pdf for free.

Attached: 51oYzgTCiyL._SX427_BO1,204,203,200_.jpg (429x500, 38K)

>No pack manager
>No system updates from comand line

What's the point of understand how this shit works?

Love to hear attitudes like this. I use everything. And all the more for me when others decide to exclude themselves.

MSDN has pretty much everything you could need

msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx

msdn.microsoft.com/en-us/library/system.net.mail.smtpclient(v=vs.110).aspx

msdn.microsoft.com/en-us/library/system.xml.xmldocument(v=vs.110).aspx

msdn.microsoft.com/en-us/library/microsoft.win32(v=vs.110).aspx


It's all there. Pretty much anything you can do in .NET can be done in powershell.

Powershell is the shell that leverages .NET. It's just as powerful as c#, without the nuisance of needing to compile stuff.

Just make sure you understand the fundamentals before diving into .NET. You need to know how to work with basic powershell variables/functions/pipes/loops first. Know what a hashtable is, what an object is. (similar but not the same as hashtable) Know when to use arrays and how ps handles output.

Bonus points: COM objects, WMI, C# imports

Powershell is so much more powerful than most people realize. You can pretty much leverage the full power of all of windows infrastructural code with powershell.

Whether it be creating a gui application with XAML/wpf, managing your drivers, interacting with the registry, the filesystem, even taking advantage of some interfaces the kernel exposes... powershell lets you do it all.

The links above are to get you thinking. Powershell isn't just a scripting language, you can write full multi-threaded applications in powershell. (though it gets tricky)

What do you guys think of my ISE theme?

Attached: theme.png (995x1036, 51K)

Кaк жe ты зaeбaл(a)

Why aren't you using vscode?

Enlighten me

He has a point. Every time I need a certain powershell module I have to go on a stupid google journey to see what obscure administrator toolpack msi it's covertly bundled in with on Microsoft's site.

I just looked it up, I didn't realize you could use that for ps also. Thanks

msdn.microsoft.com/en-us/library/system.threading(v=vs.110).aspx

msdn.microsoft.com/en-us/library/system.configuration(v=vs.110).aspx

docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/creating-.net-and-com-objects--new-object-?view=powershell-6

msdn.microsoft.com/en-us/library/system.runtime.interopservices(v=vs.110).aspx

docs.microsoft.com/en-us/windows/desktop/cimwin32prov/win32-systemsystemdriver

There's literally no limit to what you can do with powershell.

The real reason windows is often regarded as "so insecure" is because Windows has always empowered developers with insanely powerful APIs that let you do anything/everything.

And with powershell, it's easier than ever to jump in with those APIs

Oh my. Ise is pretty much dead Microsoft is moving to vscode as their official use going forward.

If you are not familiar with vscode please give it a look. It is has a great powershell plugin, countless themes. Auto code formatting.. I dont even know where to begin here.

because it's some hipster bullshit that only matters because ISE is abandonware.
VSCode does literally nothing better than ISE for pure powershell work.

In this day and age, MS killing something is generally proof positive that it is the rational choice if you're trying to do anything other than create shareholder value.

There are downsides, yes. Powershell isn't consistent across versions and MS OSs for example. That's a pain. Look at the bright side though. This is a light years jump from where things were a while ago. I only discovered powershell two or three months back and I'm pretty stoked about it.

Attached: image-4.png (1920x1033, 346K)

>Powershell isn't consistent across versions and MS OSs for example. That's a pain.

That's another pain point. My employer is on Windows 7 and hasn't upgraded from the base version of 2.0 so I'm stuck with missing/broken functionality in places if I want my scripts to run on users' computers.

>peek definition only searches the focused file and ignores opened dot-sourced files within the same active folder
>that's pretty much the only useful thing shown

meanwhile, ISESteroids.

Why, Satya.
Why do you hate us.

I recently installed Carbon on a couple of machines, and chocolatey while I was at it. I haven't used them much since though. Any experiences or other library type things?