Skip to content

Instantly share code, notes, and snippets.

View Stephanevg's full-sized avatar
:shipit:
I like computers

Stéphane Stephanevg

:shipit:
I like computers
View GitHub Profile
@Stephanevg
Stephanevg / Example11.html
Created October 16, 2018 20:49
Example11.Results.html
<html>
<head>
<title>Example 2</title>
</head>
<Body>
<h1>
Example adding loops an other operators
</h1>
@Stephanevg
Stephanevg / PSHTML_Example10.ps1
Created October 16, 2018 20:00
PSHTML Basic Example
import-module PSHTML
html {
head {
title "Basic example"
}
body {
div {
@Stephanevg
Stephanevg / PSHTML_Example10_Result.html
Last active October 16, 2018 19:55
Result for example 10
<html>
<head>
<title>Basic example</title>
</head>
<Body>
<div>
<p>
This is simply a paragraph in a div.
@Stephanevg
Stephanevg / HTMLPageWithOptions.ps1
Last active September 7, 2021 07:42
Generate a HTML page with drop down boxes using PSHTML
import-module C:\Users\taavast3\OneDrive\Repo\Projects\OpenSource\PSHTML\pshtml.psd1
$Languages = @("PowerShell","Ruby","CSharp","Python")
$HtmlDocument = html {
head{
title "woop title"
@Stephanevg
Stephanevg / PowershellDownloadLink.Json
Created September 12, 2018 07:42
Powershell Json file with all download links to the different Os versions
@Stephanevg
Stephanevg / Get-GitHistory.ps1
Created May 10, 2018 05:18
Wrapper to lists the git commit history
Function Get-GitHistory {
<#
.DESCRIPTION
One the command has been executed, press 'q' to terminate the reader.
.NOTES
current version: 0.2
Author: Stephane van Gulick
.LINK
@Stephanevg
Stephanevg / ConvertObjectTo-HTMLTable.ps1
Created April 24, 2018 04:44
Converts any object into a HTML table. (Still draft)
#This function is not working yet
$obj = Get-Process | select -First 1
$objMembers = $obj | gm
$Properties = $object | gm | ? {$_.MemberType -eq 'property' -or $_.MemberType -eq 'NoteProperty'}
Foreach($pro in $Properties){
$gmpro = $pro | gm
@Stephanevg
Stephanevg / Class.FolderDepth.ps1
Last active April 23, 2018 21:43
Short code to get the folder depth of each child element from a particular node
Class FolderDepth{
[String]$Folder
[int]$level
FolderDepth([String]$Folder,[int]$Level){
$this.Folder = $Folder
$this.level = $Level
}
}
@Stephanevg
Stephanevg / DoStuffOnModuleRemove.ps1
Created April 10, 2018 14:42
Trigger actions on module remove.
##From --> https://github.com/PowerShell/Polaris/blob/master/Polaris.psm1
# Handles the removal of the module
$ExecutionContext.SessionState.Module.OnRemove =
{
Stop-Polaris -ErrorAction SilentlyContinue
Clear-Polaris
}.GetNewClosure()
@Stephanevg
Stephanevg / Get-BoundParameters.ps1
Created March 28, 2018 19:53
Function to get the parameters from a function. This function needs to be called from within a function.
Function Get-BoundParameters {
<#
.EXAMPLE
Inside a function, call it like this:
Get-BoundParameters -Type Common
.EXAMPLE
Inside a function, call it like this:
Get-BoundParameters -Type UserDefined
#>
[CmdletBinding()]