D
D
Danila Dunno2020-07-21 17:28:34
PowerShell
Danila Dunno, 2020-07-21 17:28:34

Why does a programmer need Power Shell and is it needed at all?

Hello, I would like to know your opinion about Power Shell. On the Internet, I did not find a sensible answer to questions like: does a .Net programmer need Power Shell, and is it generally used when developing any projects / applications, for example, to automate any actions, etc.?
If you know an article in Russian or English, please throw it to read. And if you used it yourself in projects, please describe what exactly you dealt with, whether you used it yourself or there was a certain person for setting it up. In short, everything is interesting.)

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander, 2020-07-21
@NeiroNx

For example, you need to monitor folder changes and perform certain actions on these events - the fastest way is using Power Shell.

M
maaGames, 2020-07-21
@maaGames

if bat or any other scripting language was needed, then PS will also be needed. If you do not drink any scripts, then PS is not needed either. These can be build scripts, deployment scripts, whatever.

V
Vladimir Korotenko, 2020-07-21
@firedragon

What to write on the knee on steroids. For example, I raise virtual machines and sharepoint deployment script, I also perform scheduled site warm-up

M
MaxKozlov, 2020-07-22
@MaxKozlov

to quickly see how some .Net DLL works, poking around in methods is much easier in PS than compiling a project.
Type

Add-Type -Path DotNetZip.dll
$zip = New-Object Ionic.Zip.ZipFile 'myarchive.zip'
# поглядеть на свойства/методы
Get-Member -InputObject $zip
# тут же с готовым объектом можно и побаловаться, попробовать что-то
$zip.AddDirectory('D:\111')
 $zip.Save()
 $zip.Dispose()

or
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
$myconnection = New-Object MySql.Data.MySqlClient.MySqlConnection
$myconnection.ConnectionString = "database=access;server=myserver;Persist Security Info=false;user id=root;pwd=root"
$myconnection.Open()
$command = $myconnection.CreateCommand()
$command.CommandText = "show tables;"
$r = $command.ExecuteReader()
while ($r.Read()) {
$r[0]
}
$r.close()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question