PowerShell Variables Explained

preview_player
Показать описание
In this video, we do an introduction to PowerShell variables explained. Nothing but the basics but just gives you a good foundation to build on.

Video on using Write-Host

Video on String Manipulation

Video on using Foreach with PowerShell

Video on PowerShell arrays

Video on working with Dates in PowerShell

Рекомендации по теме
Комментарии
Автор

You put out great videos. Very informative and explanations are easy to follow!

KrisRay-jd
Автор

Man, I love your videos! I got my start with this series and it has become my go-to refresh for core concepts when I need a refresh after not working with it for a while. Thank you for what you do, !

joenathan
Автор

Finally someone who CAN explain. Thank you Shane! ...subscribed

skovil
Автор

Man, You are a genius in online teaching. Please, teach everything you know because you were very very useful for my interview.

danielbanaru
Автор

Thanks Shane. Great videos, easy to understand.

daye
Автор

Good stuff Shane. Trying to get my head around on how to build scripts. Cheers

beerzo
Автор

Thanks, like your presentation style. Folksy.

darrylbaker
Автор

If you're looking for a video idea, I'd like to hear about passing variables between sessions.

To narrow the scenario of discussion, I want to pass a variable out to a "secondary" session (i.e. a main script main dot-sources a secondary script -- I want to send a variable from the main script into the secondary). Also, I swear the secondary script, that has been dot-sourced quietly (-windowstyle hidden) finished running and would not pass a variable to the "main" script. I believe Invoke-Command is the way.

PowerShell release 5.
"Secondary" scripts running on the same local computer (not a remote computer).

Global variables might be good too.

Thx.

louf
Автор

It was interesting and informative what you said about occasional variable Type problems and how the memory of variables is held in the PowerShell session:
Whilst experimenting in the ISE as part of learning about variables I sometimes got some strange results.
I found that these strange results came from a combination of the memory held of the variables and the variable type not being what I expected sometimes.
( I had been familiar with running coding in MS Office VBA and developing coding in the VB Editor. Things work a bit differently there, in that usually if you alter coding and re run, then variables are usually cleared / initialised, so you start again fresh.)

alanelston
Автор

Great video. Could we delve into into Azure AD variables?

johnsnow
Автор

Hi Shane. Awesome video! I have a question on how to take data from output and turn it into a variable. Example - I'm making a rest api call to get data back from a third party. I used the following syntax to write the output to the screen:

Write-Output $response | Format-table -Wrap

Let's say the results from the call are as follows:

result

{@{sensitive=no; description=game; id=123456; group=basic}}


I would like to take the results and turn them into variables? Is this possible?

rikrod
Автор

Is it possible to permanently set a variable even when closing the terminal?

voideg
Автор

ok.. I am creating a script to run on computers to put the computer information into a CVS file so I can import into a database. I set a variable for some of the information I need. like this: $hostname = get-computerinfo |Select-Object CsDNSHostName but it returns the title CsDNSHostName as well as the actual hostname. I want just the hostname so I can put it in quotes for my CVS file. How do I do that? Is there a better way than using a variable?

juliehill
Автор

Could you please make a Video for Global Variable in PS

ufo
Автор

Is it possible to set the cdrom as a variable?

drza
Автор

Great Video share, i learn a lot, the easy way ! Wouldn;t be great if you post the link to the powershell you explained to Github or your site, like a blog ? Would be easy to execute and get out exercises !

PabloVillaronga
Автор

Hello Shane! Thank you for your videos! They are super helpful, praticularly for me as I am just starting to use powershell.
Have you done a video on exporting variables from a file (e.g. CSV) to a directory? If so, can you link it please? It would be super helpful!! Thanks!! :)


Mars

DM-zmzb
Автор

hi shane, i have a question about variables, i hope you will be able to help me undrstand -
here is have a command mixed with variables - it is not make any sense to me the built of it - its like declared $vm at the beginning of the command but then uses it inside that very command - help !
vm = Set-AzVMOperatingSystem `
-VM $vm `
-Windows `
-ComputerName myVM `
-Credential $cred `
-ProvisionVMAgent -EnableAutoUpdate

vantor
Автор

Hi,
can you please tell me the answer for the below question
Which variable cannot be modified by the administrator?
A)user created
B)automatic
C) preference
D)pre-defined

mbahr
Автор

7:50 lolll I feel you shane... Thanks for your wonderful videos!!! Love 'em!

bnisrael