Skip to content

Windows PowerShell script that will reboot Chromecast devices on my local network.

License

Notifications You must be signed in to change notification settings

nstevens1040/Reboot-Chromecast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Reboot-Chromecast

Windows PowerShell script that will reboot Chromecast devices on my local network.
You will likely need to edit this script if you want to use it.

This script uses

The script assumes that you have

  • set an environment variable named HOMEGRAPH_SERVICE_ACCOUNT to your Google service account's email address <service-account-name>@<project-id>.iam.gserviceaccount.com
  • hard-coded your Google master token by setting the environment variable GOOGLE_MASTER_TOKEN to the value of your master token
  • In this case, I have set an environment variable entitled CHROMECASTMAC to my Chromecast MAC address. This isn't necessary, but it was convenient for me during testing as a way to quickly retrieve that value.

You will need to remove the parameter DeviceName's default value unless you also happen to have a Chromecast named Nick's Bedroom TV

Quick Start

Once you have set your environment variables, you can make Reboot-Chromecast available in a Windows PowerShell session by running the commands below.

Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex (irm https://raw.githubusercontent.com/nstevens1040/Reboot-Chromecast/main/Reboot-Chromecast.ps1)

Usage

NAME
    Reboot-Chromecast
    
SYNTAX
    Reboot-Chromecast [-DeviceName] <string>  [<CommonParameters>]
    
    
PARAMETERS
    -DeviceName <string>
        
        Required?                    true
        Position?                    0
        Accept pipeline input?       false
        Parameter set name           (All)
        Aliases                      None
        Dynamic?                     false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
    
INPUTS
    None
    
    
OUTPUTS
    System.Object
    
ALIASES
    None
    

REMARKS
    None