(B15) Powershell part1 Intro - Get , Set, Start,Stop, New, Add, Copy, Move, Remove, $

Опубликовано: 14 Апрель 2022
на канале: Latif Shaik
51
1

20220414 174318
What is PowerShell
Windows PowerShell is an automated task-based command-line shell
and associated scripting language created by Microsoft.
It is the new shell of Microsoft which combines the old command
prompt (CMD) functionality with a new scripting instruction set
with built-in system administration functionality

CMD - win32
PowerShell - .Net

--modules
--AD
--DSC
--
regular cli
cmd and bash
remote access
powerdirect - nanoserver
scripting

Why use PowerShell?
It is both a scripting language and a command-line Shell.
It can interact with a different number of technologies.
Windows PowerShell allows complete access to all the types in the .NET framework.
PowerShell is object-based.
Many interfaces of GUI that Microsoft designed for its various
products are front end interfaces to PowerShell.

It is more secure than running VBScript or other scripting languages.

It allows performing repetitive tasks more efficiently by combining
multiple commands and by writing scripts. Suppose, a system
administrator wants to create hundreds of active directory users,
he can achieve this with the help of only some PowerShell cmdlets
placed in a script.

Many complex and time-consuming configurations and tasks can be
done in a second with simple cmdlets of PowerShell.

---------
The commands in the Windows PowerShell are referred to as cmdlets
pronounced as "command-lets", where each cmdlet represents a
specific function or task-based scripts.
--------------------------------
PowerShell
PowerShell ISE
CMD powershell
--------------------------
cmdlets - noun - verb

get- get information
set- change setting
start
stop
add
remove
new - create new

get-disk

get-localuser

get-netipaddress -ipconfig, ifconfig

new-item -mkdir,

get-process

stop-process
start-process

get-location --pwd

get-childitem --dir, ls

set-location "e:\batch 15 2022"

Get-Content '.\14-04 backup.txt'

New-Item -Name b15file1.txt -ItemType File

Set-Content -Value 'This is b15file1 file' .\b15file1.txt

Get-Content .\b15file1.txt

Add-Content -value 'Hello this is b15file1 file' .\b15file1.txt

New-Item -name b15 -ItemType Directory

Copy-Item .\b15file1.txt .\b15\

Get-ChildItem .\b15\

New-Item -name b15file2.txt -ItemType File

Set-Content -value 'this is b15file2 file' .\b15file2.txt

Get-Content .\b15file2.txt

Move-Item .\b15file2.txt .\b15\

Remove-Item .\b15\b15file1.txt
----------------------------

Get-Process 'putty (3)'

Stop-Process -ProcessName 'putty (3)'

https://docs.microsoft.com/en-us/powe...

-
Get-Service

Get-Service 'Application Identity'

start-service 'Application Identity'
Get-Service 'Application Identity'

Stop-Service 'Application Identity'
Get-Service 'Application Identity'
---------------------------------------
New-LocalUser -name student2 -NoPassword:$true

Set-LocalUser -name student2 -UserMayChangePassword:$false

Get-LocalUser -name student2

Set-LocalUser -name student2 -Password(read-host pass -AsSecureString)

Remove-LocalUser -name student2
--------------------------------

Get-NetIPAddress -InterfaceAlias 'Ethernet0'


----------
variable
operators
data type
print
input
--
if
for
while
switch


$
@
{}
~
[]
.
.\
./


Смотрите видео (B15) Powershell part1 Intro - Get , Set, Start,Stop, New, Add, Copy, Move, Remove, $ онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Latif Shaik 14 Апрель 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 51 раз и оно понравилось 1 людям.