This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Get remote desktop sessions for a specified computer or computers, from the Terminal | |
Services event log. Adapted from https://serverfault.com/a/687079/78216, https://ss64.com/ps/get-winevent.html | |
Requires appropriate permission on computers to call Get-WinEvent remotely, PowerShell Active Directory module. | |
If using Windows Firewall, may require enabling "Remote Event Log Management" rule (from | |
https://social.technet.microsoft.com/Forums/en-US/69fba4e0-a248-4d1c-9e0d-80071a2a446d/getwinevent-the-rpc-server-is-unavailable) | |
By Thomas Williams <https://github.com/thomasswilliams> | |
.DESCRIPTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Get history from Windows event log for events relating to startup & shutdown for a specified computer or computers. | |
Adapted from https://social.technet.microsoft.com/wiki/contents/articles/17889.powershell-script-for-shutdownreboot-events-tracker.aspx | |
By Thomas Williams <https://github.com/thomasswilliams> | |
.DESCRIPTION | |
Pass one or more computer names, or run without parameters to be prompted for computer name(s). | |
.PARAMETER computers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
For a passed computer, collection of computers, or computer name(s) from prompt, return the boot time | |
and calculated uptime in days, hours and minutes. | |
By Thomas Williams <https://github.com/thomasswilliams> | |
.DESCRIPTION | |
Pass one or more computer names, or run without parameters to be prompted for computer name(s). Queries | |
WMI/CIM Win32_OperatingSystem class "LastBootUpTime", so need appropriate permissions, and WS-Management | |
service needs to be running. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "pedals-api-nov-2019", | |
"version": "0.0.2", | |
"scripts": { | |
"serve": "npm run tsc && node ./dist/server.js", | |
"tsc": "tsc", | |
"lint": "eslint \"src/**/*.ts\"" | |
}, | |
"eslintConfig": { | |
"root": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"esModuleInterop": true, | |
"target": "es6", | |
"noImplicitAny": true, | |
"moduleResolution": "node", | |
"sourceMap": true, | |
"outDir": "dist", | |
"baseUrl": ".", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in src directory | |
import express from "express"; | |
const app = express(); | |
// route: get pedals collection | |
app.get("/pedals", (req, res) => { | |
console.log("Got pedals collection"); | |
// hard-code JSON response | |
res.send({ pedals: [{ name: "Boss SY-1", id: 1 }] }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "pedals-api-nov-2019", | |
"version": "0.0.1", | |
"scripts": { | |
"serve": "npm run tsc && node ./dist/server.js", | |
"tsc": "tsc" | |
}, | |
"devDependencies": { | |
"@types/express": "^4.17.2", | |
"@types/node": "^12.12.8", |