We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

PowerShell IoT - What .Net Core has done for your Raspberry Pi

00:00

Formal Metadata

Title
PowerShell IoT - What .Net Core has done for your Raspberry Pi
Title of Series
Number of Parts
60
Author
License
CC Attribution - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language
Producer
Production Year2018

Content Metadata

Subject Area
Genre
Abstract
Raspberry Pis, Windows IoT, dot net core, scripted TCP solutions, this session has it all! Learn how set up a TCP server using pure PowerShell on your favorite credit-card sized computer.
Core dump.NET FrameworkCore dumpGroup actionCoefficient of determinationVirtualizationComputer networkVirtual machineConfiguration spaceProjective planeData managementCuboidGame theoryDistanceCodeComputer animation
Covering spaceArmCore dumpMedical imagingPlastikkarteBootingServer (computing)Core dump.NET FrameworkBootingBitInformationDemo (music)GoogolCuboidMedical imagingPlastikkarteQuicksortCovering spaceSoftwareArmFunctional (mathematics)BuildingRight angleSoftware repository2 (number)Server (computing)Variable (mathematics)TouchscreenArithmetic meanComputer animation
Demo (music)Core dumpInclusion mapTelephone number mappingGauge theoryMenu (computing)InternetworkingVideoconferencingRepository (publishing)Key (cryptography)Computer animationLecture/Conference
Core dumpInstallation artMusical ensembleNormed vector spaceElectronic mailing listProcess (computing)Multiplication signLine (geometry)Source code
Core dumpMenu (computing)Execution unitCloningRepository (publishing)Software repositorySoftware testingBootstrap aggregatingSource code
Core dumpCurvatureLimit (category theory)Source code
Core dumpQuantumMaxima and minimaLink (knot theory)SoftwareCircleBinary codeRevision controlSoftware developerInstallation artDemo (music)Coefficient of determinationPiComputer clusterProcess (computing)Function (mathematics)Core dump.NET FrameworkSlide ruleSoftware frameworkMassMultiplication signSource code
Core dumpDemo (music)Gamma functionPiModule (mathematics)Medical imaging.NET FrameworkArithmetic progressionComputer animationLecture/Conference
Core dumpMiniDiscPoint (geometry)Projective planePiComputer programmingMedical imagingMiniDiscMultiplication signCartesian coordinate systemComputer animationLecture/Conference
Core dumpGamma functionSimultaneous localization and mappingMiniDiscSystem callSoftware developerState of matterCodeVolume (thermodynamics)Logic gateType theoryStreaming mediaComputer fileObject (grammar)Computer networkForcing (mathematics)Arithmetic meanError messageParameter (computer programming)File formatSocial classPhysical systemAbstractionGame controllerInheritance (object-oriented programming)Variable (mathematics)Medical imagingOperator (mathematics)Buffer solutionQuicksortCryptography.NET FrameworkSemiconductor memoryAsynchronous Transfer ModeModule (mathematics)Computer animation
Core dumpMaxima and minimaMenu (computing)MathematicsSimulationEmulationASCIILocal GroupMaß <Mathematik>Partition (number theory)File formatWindowBackupDefault (computer science)Traffic reportingGroup actionMedical imagingPiBootingFunction (mathematics)Buffer solutionComputer networkLine (geometry)PasswordString (computer science)Arithmetic progressionCodierung <Programmierung>Validity (statistics)Virtual machineContent (media)EncryptionMiniDiscNeuroinformatikCompilation albumReading (process)PlastikkarteComputer fileMereologyBitGoodness of fitGame controllerInterface (computing)Data managementControl flowLoop (music)FlagNumberInformation securityKey (cryptography)HexagonVolume (thermodynamics)Keyboard shortcutFunctional (mathematics)Coefficient of determinationRadio-frequency identificationPseudozufallszahlenoutputIterationMultiplication signMobile appType theoryVideo game consolePower (physics)Computer animation
Core dumpVideoconferencingRevision controlKey (cryptography)Default (computer science)Computer animation
Core dumpGastropod shellFunction (mathematics)Key (cryptography)Software repositoryGodTouchscreenDemo (music)Computer animation
Core dumpWechselseitige InformationServer (computing)BitBlogAuthenticationExistenceCodeElement (mathematics)
Core dumpServer (computing)Error messageModule (mathematics)BitMathematicsSoftware repositorySource code
Drill commandsCore dumpSynchronizationArrow of timeVoltmeterInclusion mapEmailMaxima and minimaExecution unitString (computer science)Block (periodic table)Computer fileSemiconductor memoryLengthSystem callReading (process)BuildingMultiplication signCartesian coordinate systemClient (computing)Server (computing)Function (mathematics)Virtual machineConnected spaceLoop (music)Complex (psychology)Socket-SchnittstelleWindow.NET FrameworkSocial classStreaming mediaObject (grammar)Revision controlVideo game consoleScripting language
Core dumpHardware-in-the-loop simulationPiFunction (mathematics)Serial portConnected spaceComputer animation
Metropolitan area networkCore dumpExecution unitMenu (computing)Wechselseitige InformationString (computer science)Wide area networkMeta elementBinary codeSensitivity analysisServer (computing)Network socketComputer fileCore dumpSerial portDifferent (Kate Ryan album)Object (grammar)CASE <Informatik>PiRemote procedure callPhysical systemFunction (mathematics)Process (computing)String (computer science)Streaming mediaScripting languageSemiconductor memoryDirectory serviceInformationConnected spaceCommunications protocol1 (number)Client (computing)Aliasing.NET FrameworkRevision controlComputer animation
Core dumpIdeal (ethics)Process (computing)BootingDemo (music)Source code
Core dumpError messageRegular graphBitAuthenticationPiScripting languageSoftware bugVirtual machineComputer animation
Core dumpEquals signLine (geometry)Internet forumPiDifferent (Kate Ryan album)Text editorScheduling (computing)Source codeComputer animation
Core dumpIndependent set (graph theory)Revision controlInteractive televisionGame controllerBootingRight angleFerry CorstenServer (computing)
Core dumpObject (grammar)Function (mathematics)Point (geometry)Reading (process)Directory serviceString (computer science)InformationComputer animation
Core dumpSoftware frameworkComputer networkSocket-SchnittstelleBuildingServer (computing)DebuggerWindow.NET FrameworkDirection (geometry)Software frameworkReading (process)Socket-SchnittstelleServer (computing)PeripheralFront and back endsInternetworkingAreaComputer programmingWeb pageTelecommunicationSurfaceDemosceneBlock (periodic table)Scripting languageForm (programming)BlogObject (grammar)Element (mathematics)Network socketProgrammer (hardware)Open setLink (knot theory)Computer animation
Core dumpRow (database)Coma BerenicesComputer animationJSONXML
Transcript: English(auto-generated)
Welcome to PowerShell IOT what dotnet core has done for your Raspberry Pi or if that's just too many buzzwords for you The Posh Berries taste like Posh Berries
My name is Eli Hess, I work as a DevOps engineer for a company out in Minnesota called net game technology We host for the medical community. I work on like config management for about 2,000 plus machines Virtual like 15,000 that are physical a Lot of fun
Before we get started. I thought I'd get a feel for where you guys are at who here owns a Raspberry Pi Nice who here has taken that Raspberry Pi out of the box All right. Okay. Has anyone done anything? They're particularly proud of that. They'd want to share with the group any fun projects
It's a fun project you Well that Nice that's really cool Myself I'm in the middle of a project that I'm hoping to be proud of when it's done. I Had wanted to get it finished before I came here, but didn't quite work out
I'm trying to turn my dog into a Bluetooth beacon See, I'm incredibly absent-minded. I'm the guy that puts the tea on and then walks away and five minutes later I hear it whistling and go. Oh, yeah, I was making tea so I thought I'd do the same thing to my dog because I put him out in the backyard and Go back to coding or whatever and I forget that I let my dog out but unlike the tea kettle
He doesn't whistle when he's ready. He just stares passive-aggressively at the door and freezes So I'm gonna turn him into a Bluetooth beacon and then when he hits that proximity alert I'll send a push notification my phone or something like that. If you follow me on github I'll put the code up there when I'm done and maybe blog about it or something
Today what we're gonna cover is a brief history of PowerShell core on ARM according to me A cross compiling PowerShell core for your Raspbian imaging an SD card using semi-pure PowerShell Creating a headless Pi at first boot with an encrypted PSK Just using dotnet and then using PowerShell core to set up a TCP server for some sort of janky PS remoting
As you can tell most of the things we're doing today have a little bit of a qualifier on them like all home automation should So Actually before we get into the demo I'll just go over the history here about six seven months ago
I was getting really excited about all this cross-platform stuff and I thought well if PowerShell can run on Linux now. It should be able to run on my Raspberry Pi so I Hooked up my Pi and started googling. I couldn't find anyone who had been doing this and so then I had to head it over to the Microsoft repo and
The flat-out said it's not supported, but I thought well, it's not supported, but that doesn't mean it won't work right so Like you know I'm assuming you guys are like me if you're in this room, and you like to tinker so I cloned to the repo down to the Raspberry Pi and Popped over to the the Linux build instructions, and I kid you not the very first instruction on the Linux build is install PowerShell
Because they took the software that you're trying to compile and use it to compile the software that you're trying to compile So I was like well it probably doesn't actually need PowerShell Maybe it's just a build wrapper, so I opened it up and expanded out all the functions And yeah, it didn't need PowerShell to do anything. They were just making it convenient and in their defense
Everywhere that it's supported to compile. It's also supported to be installed, so it's just me being an idiot trying to do this So Then I started stepping through all the build steps, and I made it as far as Installing the dotnet core dependency because dotnet core the SDK is also not supported on your Raspberry Pi
Because what kind of an idiot would try to compile things on their Raspberry Pi Last I checked it's still not supported. I think the latest Info was in January. They haven't said what they're running into but yeah
So then I thought well, okay, I can't compile it here But maybe I can compile it somewhere else and copy it over here, so I popped up in a in a boot to 1604 box repeated all the steps I had just done you know swapping in a couple variables removing some of the Hard-coded you can't do this things and
Got to the end it compiled clean. I copied it over to my Pi installed some dependencies Clicked to go and the PowerShell banner spread across the screen And I was like ah I'm brilliant and I had about two seconds of feeling good about myself before it hit a segmentation fault and crashed and burned never even got to a prompt I Popped over to the repo to submit it as an issue and somebody Steve Desmond any chance you're in here. No, okay
He had beat me to it by a couple of weeks submitted the issue Joey's team took a look at it, and it was maybe a month later that it was Compiling clean and runnable on a on a raspberry Pi they posted the instructions to do so right there
Which you won't find anymore because they've made it even easier for you to do this just by posting an experimental build right on the repo so even though You don't have to cross compile anymore, and you can just download that experimental build This is PowerShell Summit, and we deep dive so we're gonna walk through that
It involves a lot of internet access, and they warned me away from internet access related to activities So I took a video of me doing this I've got it playing at 2x speed Because it takes a couple minutes. Let's see if it
nice Okay, so I think I just skipped that first command what it's doing is adding the repository key Microsoft repository key to your Local store so that after you've downloaded the package it can confirm that that's the package you downloaded
The next command there is adding the Microsoft repository To the list and then you need to do an apt-get update Which updates what's available so that you can then install PowerShell like they had initially told me to So list updated and install PowerShell
Now I'd highly recommend all of you go about and do this even though you don't have to anymore I learned a lot by going through the compile process where you're Living in a really cool time where Mike Microsoft is actually open sourcing the products, so take them home tear them apart
You know swap out commandlet lines and see what happens all right PowerShell has been installed
Repo needs to be clones next it's a you have to do a recursive clone because they have a sub repository linking out to Google test Repo takes a second there and once you have
Finished cloning the repo right there at the end you can see the Google test repo I'm going to start the bootstrap. I realized I should probably run it with elevated permissions
So I back out do it one more time. Okay, so there they're importing that build script. I told you about
It's fun to peek into that and expand it and see what it's doing And Then we start building the dependencies now. This is just going through installing native binaries checking to see if dotnet core is installed and if it's not
it Installs it. I'm gonna skip ahead here because it takes a bit. It's also checking to make sure you're not Some kind of idiot trying to do this on a Raspberry Pi and stops you if you are owned installs dotnet
The version on Ubuntu comes with the SDK if you guys are into development This is also how you would go about developing software for your Raspberry Pi you'd want to Install that net somewhere else and then cross compile and copy it over. Are there developers in the room?
Cool, I have a recommended book at the end of this for those of you who didn't raise your hand. It's Just a massive compendium on c-sharp dotnet development, but it's it's by far the best thing I've I've read with a micro framework
I haven't looked at it yet. I'm definitely going to when I get home because that sounds really good I was excited about the Microsoft guy who presented the lightning demo the other day, too If you guys saw that where he was turning on lights and working with sensors
Since I didn't have my you know, whistling tea kettle dog ready It's cool that he brought some gadgets into the game, right? So this finishes up And then you run the build and once again, I'm gonna skip ahead through here
the build process is really interesting because they're actually taking the native binaries in Linux and and Putting hard links into the compile so if they're not there the compile completely fails and it's important for another reason which I'm gonna circle back to once we're actually on our pie
So we have a lot to cover and less time to do it I'll have us I've got a slide for it that I'll pop up This last command I'm running here is get ps output and I'm just running it to show you that once it's done
You can access where PowerShell Was compiled to really easily with this command and then below it here You can see this SCP command if your Raspberry Pi were online at this time and ready to go you could run this to copy it Right over your pie without any fuss at all. Now. We have our pie
Let's talk about imaging our pie with dotnet I Made a module for this it's up on the PowerShell Gallery called posh berry pie and with this module
You can actually image and back up your raspberry pie I'm gonna get this going because it takes a minute. No one likes to wait for progress bars. And there we go
So some of you who have You know done more than plug your pie in are probably wondering why would I do this? We have Etcher We've got win 30 do disk imager. What's the point of putting the imaging into PowerShell? Well on the one hand I find myself doing these weekend projects all the time and coming up with like
Application bloat where like three months later. I'm going back to my ad remove programs going out What did I even use that for and you know having to uninstall things? So this reduces that and on the other hand I wanted to see if I could And again, not only can I do it but it's it's just as fast as Etcher went 32 disk imager
It could definitely use Some cleanup yet, you know, I've got it to the working state But not to the like really polished state and I've expanded the code out here from what it's doing Like I said, this is all it's all up on github in a nice pretty module
With error handling more that's gonna be present here and all that So right out of the gate you can see why I called it impure PowerShell I'm doing an ad type on win 32 disk access object that is handling some native calls for me to grab the disk handle and Lock the volume that sort of thing. I think I can do this with just dotnet objects
Tapping into the interop assembly, but I haven't tried that yet then we initialize some variables check to make sure the image exists Here I'm making sure that you're not running against the system drive because that would be awful and I also put a hard stop in if the volume that you're targeting is not empty
After hearing Bruce the other day I feel like I should add a force parameter for this so that you know I'm not gonna hold the gun But if you want to shoot yourself in the foot and format over something then you can And then we get our disk access And if everything checks out We start working with our stream objects and readers
Since not many developers are in here You probably aren't aware that the stream class and dotnet is like the base class that all IO operations happen on So there's it's an abstract class meaning everything else is inheriting it and they've got streams for file network memory
cryptography You name it. They've got a stream for it if it's if it's IO and because they do it that way They're all pretty similarly worked with All I'm doing here, I'll talk about this control C thing in a minute is Initializing a buffer Initializing the stream with the file name the mode. I want to open and the access
I want to give it and then I pass that file stream to a binary reader to do all of my IO Back to this control C thing I wanted to be able to you know break out of this if I decided that it was bad and we just finished here This format that pops up is because one of the partitions is a Linux partition and Windows can't read it
Yeah, so I want to be able to break out of that if you decided you didn't want to format this image or if you were doing a backup you wanted to break out of your backup and You can control C out of that by default But it doesn't recognize that you've control C to out of it in any fashion that I was able to
You know then release the disk handles So if you run console treat control C as input as true Then you just every iteration through your loop Check to see if somebody's pressed the key if it's control C You flip a flag and then you can handle whatever it is. You wanted to handle at the break
The loop itself is looking to see if as I'm moving through the file Where's the offset at like what position in the file am I at and has it hit the file length? And if so, then you're done and everything is good
Read bytes. Like I said you pass it a buffer Offsets where you want to read and how much you want to read so it fills up this buffer Does some validation on the content of the buffer? I'm not going to get into it because it gets technical quickly and then writes the buffer to my SD card and Then keeps going through and as it's doing it
We've got some progress reporting and in the end as I said, we need to release the disk and all that And now once we have our image to pie we do on time The next step in interacting with your pie is making it headless You can do all of this
After you've like plugged it in and logged in and all that But as much fun as it is to interrupt my girlfriends, you know Sunday afternoon Netflix binging by plugging my tiny computer into the TV and sitting in front of it with a keyboard. I thought Do it all remotely if possible, you know so The makers of raspbian have actually made this really easy for you
Initially, all you have to do to enable SSH remoting is copy Make a file on the boot volume. That's just SSH no content. So this commandlet is not impressive But it is it exists This next one enabling Wi-Fi is a little bit more impressive
Because enable Wi-Fi you can just put the WPA supplicant comp file on the boot partition And with your Wi-Fi settings and it'll grab them and start them up right away but you would have to put your password in plain text to Do that from a Windows machine Linux they have this command WPA passphrase that does the encryption for you
I'm gonna show you the output of that in a second, but on I Need to actually run this don't I Windows
so username for this is just the s ID SS ID of my network and then Password if I type it in correctly Yeah, so what it's doing under the hood is First it has a salt
Does an ASCII byte array of your SS ID It then passes that to this RFC 28 98 to drive bytes Object with your password in plain text. No, that's not my actual password. Please don't hack my phone and How many iterations to use to derive to then derive the key you then take that object it has a get bytes
Function on it you tell it how many random or pseudo random key bytes according to the white paper You want to pull from that and it just pulls these bytes which you are then converted to a hex string and the output
looks Like This that is a significant number that was what I found Linux to be doing under that Which wasn't all that easy to find I had read a lot of really boring security white papers on this particular Sunday afternoon
The file output just looks like this You're telling it Control interface what group has access country code. I made a thing that you can change SSID you can change pre shared key And then your key management
You can also change and the most important part is when you're outputting this file to your boot drive You need to fix the line endings to be Linux style line endings and encode in ASCII so this Should mean we have a headless pie here. If it doesn't I have a pre baked headless pie that we can
Patch into take a second to power up and because it's on my phone I got a Found a net analyzer app. That's really nice for when you're using your phone as a Wi-Fi hotspot
Any other questions while we're waiting for it to boot up? You should just take a second I haven't thought about getting my dog to participate in the automation
I've thought about cutting a hole in the door and you know Maybe switching to an RFID or something that just opens when he gets to the door Once again, I don't know that my girlfriend will be very keen on
Me cutting a hole in the door so we have joined the network and Should be able to Hop in I'm gonna first copy over PowerShell From the previous video. This is the copy of PowerShell that I
compiled
except the host key Default credentials and like I said, please don't hack me so I can now show you the Linux version of that
WPA passphrase and you can see the output key is the same one that I've got down there Quick scanning SCP is almost done here while that's going on. I also need to install
the Prerequisite here Hopefully this works for me I was running through this demo this morning and the
Repo was not available or something. I had to switch to my prebaked Alright, so I'm gonna hop over to PowerShell
Give it a run No first I'm gonna extract it
Alright now I'm gonna get her up demo gods be good to me So it would be right here where the banner came across the screen and then we hit the segmentation fault
I'm just waiting for it to do it. There we go Yay Thank You demo gods All right now we get to get into the fun stuff fun stuff I mean
This is code that I took Elements of from blog that Bo Prox did on a TCP server scripting I've stripped out The authentication bits which you will definitely want to add back in if you decide to use this anywhere other than your home lab because It's it's just a wide-open thing for anybody to run whatever they want if they know it's exists. Don't tell
Lee so Right out of the way. We can just do install module posh. Berry Pi as I said it is on the gallery I would love it if you guys contributed, you know make changes help me out here if it becomes a
Raspberry Pi module that'd be fun, you know, lots of people use other than just me. Otherwise, I'm gonna keep using it and should Give me that trusted repo error in a second here
Everything runs just a little bit slower on your Raspberry Pi
But you've got to give it up to the PowerShell team because oh, this is just so easy all right, so we have our Raspberry Pi let's make it a TCP server. So right there what I have done
Is a defaulting to port 1655 You can change that to whatever you want. I create a listener using the sockets Class fun fact the sockets class was actually made for Unix machines and Windows adopted it
Listener dot start opens up the port start listening for incoming connections and then we enter our loop looking for data Now this call I'm doing here except TCP client is a blocking call which means after I Click go on that. I'm not gonna able to do anything else on the console because it's just sitting there waiting and listening
There's an asynchronous version of this call that you can and I probably will implement in the future I just wanted to keep it simple for the purposes of the demo And if it were asynchronous then you could go back to doing whatever you want And the TCP server would just run in the background and wait
You'll see some familiar objects here stream as I said the base object for all I owe Create one of those do it get stream as soon as data is available it Does the read like last time with the file I owe you passing it a byte
Where you want to start and the length of the bytes to read into and then we're using a string builder object Which is another really fun object in dotnet Because if you don't know strings and dotnet are immutable So any string manipulation you do is actually destroying the original string and creating a brand new one with whatever you've done to it
This is really important the more Manipulation you plan to do with that string. So if you're building out really long complex Outputs or commands with a lot of appends doing a lot of manipulation it like that The IO actually adds up pretty quick you get memory intensive slow
applications string builder was created to Help us out with that where anything that's happening to it it happens to the exact same block in memory and then once you're done you just do a to string on your string builder and There you have it. You get your your string command So it's listening. It's building a string and
Then once it has it it Does a script block dot invoke on that string and returns the data to a variable data? We then serialize that data Get the bytes and write it right back into
The stream we're able to do this because in this case, I know every time I run a command against the server There's gonna be output. It's gonna come back I'm gonna be listening. I Think the IP was 208. Is that right?
So I'm gonna do invoke pie command my pie and you can see my command that I was passing was right output hello world and Return to me was hello world back on the pie. It's running in verbose. We can see exactly what happened it
Accepted this new connection looked at how many bytes were available Read them in made sure that the bytes that were available were received Ran the command serialize that and then echoed it right back to me The invoke pie command looks really similar to the server command
You're just creating an endpoint which is a socket underneath it TCP the protocol doesn't really have a client server Memory to it once the connection exists. It's just two streams talking back and forth. So a lot of this stuff looks
identical So in this case, I met Encoding the command that I'm passing Writing it to the stream Going out and then immediately Putting up a blocking wait to see what's coming back because I know the server is gonna toss the output back to me
It gets the outputs again using a string builder slices it all together and then D serial deserializes that data to get me the typical Deserialized objects that you get when you do any PS remoting. I can prove this here
So now I'm Put the right IP in now the command I'm running is get process Pwsh which is the new PowerShell process if you look At get member on that output you can see
Do you serialize system diagnostics process? and That's what it looks like. It just looks like get process An important difference here is that a difference in running commands on your
dotnet core Linux version of PowerShell versus your other ones are Aliases that you might be really used to using do not behave the same way So like this is I said, I'd be circling back to the native binaries that are being used Things like LS are actually running LS on a Linux machine, which means you are not getting a
bunch of file info and directory info objects back when you run that you're getting string just a String object that you could then parse like you would before but it's not going to behave the way that you think it would in PowerShell and I can
Show you this. All right, so output
It's a get child item of where PowerShell is running it, but it's not actually get child item. It's LS String object, so if you wanted to get get child item you actually need to run
Get child item I think a lot of scripts are going to need to be updated out in the wild Because of things like this Any aliasing that you have floating around in your scripts should get stripped out put in the actual cmdlet We Hit the snag and I'm not sure why
Another reason not to use this in production. There's case sensitivity issues that I found Might be able to go with just running it again
Broken pipe interesting shutting it down and starting it back up things are not happy
Okay, that's gonna reboot because something went wrong there like it does in a demo
Any questions so far? How are we doing? lots of fun You sir. Yep
Yep. Yep, you can absolutely do that. I've remotely shut down my pies with this You know anything you you could normally run natively you could do you could kick off Python scripts if you've got them set up that
way It it works pretty well It needs some some loving You know some little bit of TLC because of the the asynchronous stuff needs to be fixed You need to add authentication back in if you're gonna put it anywhere other than your house
But it's a fun little way to do some PS remoting on your pie I'm surprised. No one has asked this question yet. Why not? Just use the native PS remoting on your Raspberry Pi I actually tried to set it up and when I initially set out to do this They hadn't even talked about native remoting using SSH
in PowerShell yet, so When they brought that up, I was like, oh well that eliminates the need for any of this But I tried to get it set up and I couldn't get it working It could be user error if anyone has got it working you can raise your hand and I'd have love to talk to you afterwards I've also heard there's some weirdness with pseudoing
in PowerShell remoting to just regular Ubuntu machines Someone told me that that wasn't working quite the way you think it is like it says it's pseudoing but it's not really pseudoing So there's still some bugs to be worked out And I'm sure there's a whole plethora of git issues out there
Doing so Restart this session what I should have done before I did that to show you guys. This is if you just want it running
Anytime your pie starts up. It's really easy to do with crontab crontab-e for scheduling there are
Half dozen different ways to have something start up when your pie starts. I found this one to be the most intuitive I'm using nano as my editor this command here to get it going So what's that what that's telling it is at reboot run elevated the version of PowerShell
No exit non interactive and the command is just to start the TCP server Control O and control X gets you back So if we back into PowerShell here
See if I can finish showing the get child item as you can see everything just shifted to the right
I don't know why does that?
There we go So get child item versus LS object You're actually getting directory info objects versus the string output To finish off that point Any more questions Doing good
All right We're actually busting through this faster than ever Nervous talking quickly, I guess the recommended reading I was telling you about is up here. I'll get it nice and big for you Yep, and no problem
Okay, so the big book is C sharp 6.0 and the dotnet 4.6 framework as I said This thing is massive weighs probably five pounds
It's It's just wonderful like if you're honestly I think if you really like PowerShell you should be moving in this direction because the more complicated your scripts get the more you end up interacting with these base dotnet objects and
Even if you just stepped through this book to feel More comfortable with dotnet even if you weren't gonna like try to become a C sharp programmer. It's It It'll teach you things about What's going on behind the scenes that will help you in your debugging in your troubleshooting. It'll make your scripts
scriptwriting more elegant and Efficient But yeah, it steps through all the way from the beginning of this is you know how to make an if block all the way to the end where you are creating a
WPF, you know gooey things. I know gooeys are bad, but WPF gooey forms you've got SQL backend stuff that you're hooking into and Windows communication foundation it just taps into like I Want to say surface level, but it actually manages to give you a pretty comprehensive overview of like every area of dotnet
It's really good this next book TCP IP sockets and C. Sharp is I Want to say about 15 years old now, and it's still very relevant It was written for a college program of some kind
It's only 200 pages It's a really easy read and it has you doing stuff like I was just doing where you're setting up TCP servers it talks about setting them up asynchronously and And Yeah, you get into a lot of peripheral things
Within TCP IP and it goes over the framework itself and how the internet works you know how all of your communications are going which is again like we should be you know learning the back end if we're gonna be tinkering with the front end and That last link which I did not expand out for you is the blog that Bo Prox did about building a TCP server
It's really good blog he starts with just the base element of like opening up a socket and Then you can you know run a netstat to see that your sockets open create a connection go through It's a it's a good block
And then steps through it, so I'm really grateful for him doing that and That's all I have for you guys, so if you don't have questions, thank you