Windows Core IoT – Running PowerShell scripts on a Raspberry PI3

Microsoft released a Windows 10 IoT Core version for Raspberry PI 2 & 3.

To install this it just go here select your hardware follow the steps, and  it will go as a piece of a PI  Winking smile

 

image

Windows IoT Web Interface

Once you have the Windows Core IoT running on your RPI you can access it over the web

IP address + Port 8080

image

Access using the Windows 10 Client App

Don’t forget to switch on the REMOTE SERVER switch first.

image

Powershell access to Windows IoT on as PI3

Next you can connect to it using Powershell

Run the PS IDE as administrator and run this command.

cls

net start WinRM

Set-Item WSMan:\localhost\Client\TrustedHosts -Value rpi3

Enter-PSSession -ComputerName rpi3 -Credential administrator

Once logged in remotely using PS WSMAN connection, see the device name appearing.

image

You can check the PS Version : Check PS Version

Windows IoT Dashboard Application

You can also use the dashboard to launch a PS Session

image

File Sharing and internet connection Sharing

https://developer.microsoft.com/en-us/windows/iot/docs/windowsfilesharing

https://developer.microsoft.com/en-us/windows/iot/docs/internetconnectionsharing

You can also connect to the file system using a regular Share access.

image

 

Starting the FTP server on IOT

https://developer.microsoft.com/en-us/windows/iot/docs/ftp

Use PS and type start C:\Windows\System32\ftpd.exe

Connect using SSH Terminal

https://developer.microsoft.com/en-us/windows/iot/docs/ssh

Windows 10 IoT Core Command Line Utils

https://developer.microsoft.com/en-us/windows/iot/Docs/CommandLineUtils

Many command line Utils are at your disposal :

image

You can run regular PS Commands against the RPI3 Smile

image

There is also a screen capturer to make print screens : Screencapture.exe

image

image

Example

image

 

WMI using WMIC Util over WSMAN PS connection

https://technet.microsoft.com/en-us/library/bb742610.aspx

wmic bios

wmic cpu get name

wmic cpu get maxclockspeed

image

Here you can see that the RPI3 runs on an ARM 7 processor at 1200 Mhz

WMI Access from a desktop host using WBEM

This opens a lot of possibilities for us scripters to create apps and retrieve system data and more …

Remote access to PI3 WMI on Windows IoT using WBEM : Example

MS Firewall Logging Setting

You can activate the Firewall logging which makes it easy for debugging.

image

image

AU3 Powershell Module on Raspberry PI3

First copy the libraries on the RPI3

image

Here you can see all the Cmdlet’s from the AU3 Powershell module

 

image

Not that you can do a lot with it, since all the underlying AU3 Dll’s have been compiled using an X86 architecture.

And they will not run on an ARM architecture unfortunately.

Happy Scripting …

Enjoy !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: