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 / Get-URLData.ps1
Last active September 2, 2020 08:54
This function will return an object that parse a URL and returns all the detailed information in a PowerShell object
Function Get-URLData {
<#
.SYNOPSIS
This function parses a URL and returns an object with all the detailed information of it
.DESCRIPTION
Long description
.EXAMPLE
Get-UrlData -Url 'https://Google.com/Search'
@Stephanevg
Stephanevg / Get-LoremName.ps1
Created March 3, 2019 19:06 — forked from joegasper/Get-LoremName.ps1
Generate random names and accounts based on Lorem Ipsum
<#
.Synopsis
Return a name based on Lorem Ipsum.
.DESCRIPTION
Calls public Loren Ipsum API and returns name and account name if requested.
.EXAMPLE
Get-LoremName
FirstName LastName
--------- --------
Plane Gloriosam
@Stephanevg
Stephanevg / PSHTML_Basic_Table.ps1
Created February 5, 2019 21:14
Creation of Basic PSHTMLTable.ps1
p{
h2 "Example with HTML table"
table{
caption "This is a table generated with PSHTML"
thead {
tr{
th "number1"
th "number2"
th "number3"
@Stephanevg
Stephanevg / PSHTMLInFunctions.ps1
Last active September 7, 2021 07:45
To answer your case of having pshtml in functions
Function Write-Header {
$Header =
Head{
'{0}'
'{1}'
}#end of header
@Stephanevg
Stephanevg / Get-PesterTests.ps1
Created January 4, 2019 18:32
Code to scan for pester tests in a file. It return IT desccribe blocks
$Path = "PahtToFile.Tests.Ps1"
Function Get-PesterITBlock {
[CmdletBinding()]
Param(
$Path,
$InputObject
)
if($Path){
$P = Get-Item -path $Path
@Stephanevg
Stephanevg / New-WebServiceProxyProxy.ps1
Created October 17, 2018 15:37
Execute a SOAP call using New-WebService behind a proxy
Function New-WebServiceProxyProxy {
[CmdletBinding()]
Param(
$proxyURL,
[Parameter(Mandatory=$true)]
$Uri
)
$proxyObject = [System.Net.WebProxy]::new($proxyURL)
$TempFile = [System.IO.Path]::GetTempFileName() + "_wsdl.xml"
@Stephanevg
Stephanevg / templates.html
Created October 16, 2018 21:43
templates.html
<header>
<h1>This is an example generated using PSHTML Templates</h1>
</header>
<body>
<h2>This comes from a template file</h2>
</body>
<footer>
<div>
<h4>This is the footer from a template</h4>
</div>
@Stephanevg
Stephanevg / templates.ps1
Last active October 16, 2018 21:42
templates.ps1
#body.ps1 - Contains ->
h2 "This comes from a template file"
# footer.ps1 Contains ->
div {
h4 "This is the footer from a template"
p{
"Copyright from template"
}
}
@Stephanevg
Stephanevg / templating.ps1
Created October 16, 2018 21:28
templating.ps1
html{
Header{
h1 "This is an example generated using PSHTML Templates"
}
Body{
include -name Body
}
Footer{
@Stephanevg
Stephanevg / Example11.ps1
Created October 16, 2018 20:51
Example11.ps1
import-module PSHTML
html {
head {
title "Example 2"
}
body {