Answer the question
In order to leave comments, you need to log in
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
For example, you need to monitor folder changes and perform certain actions on these events - the fastest way is using Power Shell.
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.
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
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()
[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 questionAsk a Question
731 491 924 answers to any question