Skip to content

Instantly share code, notes, and snippets.

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

Van Gulick Stephanevg

:octocat:
I like computers
View GitHub Profile
@Stephanevg
Stephanevg / get-fqdn.ps1
Created November 26, 2019 06:25
returns FQDN from the local computerNAme.
([System.Net.Dns]::GetHostByName(($env:computerName))).HostName
Import-module Polaris -force
# Using a script block
New-PolarisPostRoute -Path "/Pcc" -ScriptBlock {
$json = $Request.Body
$comp = $json.computerName
$FileName = $Json.FileName
$return = $comp + $FileName
$response.Send($return)
@Stephanevg
Stephanevg / javascript_bug.ps1
Created July 3, 2019 15:27
reproduction of Javascript bug
<html>
<head>
<!--
Uncomenting this section, and commenting the links below, actually works...
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
-->
<Link rel='stylesheet' type=text/css href='C:/Program Files/WindowsPowerShell/Modules/PSHTML/0.7.11/Assets/BootStrap/bootstrap.min.css'>
@Stephanevg
Stephanevg / tabs.ps1
Created July 3, 2019 08:25
create tabs with PSHTML and bootstrap
<#
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</head>
@Stephanevg
Stephanevg / appveyor.yml
Created June 29, 2019 01:07
block rdp to troubleshoot machine
image:
- Previous Ubuntu
- Visual Studio 2015
install:
- ps: >-
.\CI\02_Install.ps1
build_script:
- ps: >-
write-host "Skipping build"
Import-Module C:\Users\taavast3\OneDrive\Repo\Projects\OpenSource\PSHTML\PSHTML\PSHTML.psd1 -Force
Import-Module Polaris -Force
New-PolarisGetRoute "/" -Scriptblock {
$GroupName = "TestGroup"
$HTML = .\Routes\LocalUserView.ps1 -GroupName $GroupName
$Response.SetContentType('text/html')
Param(
[String]$UserSID = 'S-1-5-21-3890033740-644365979-2086776761-1001',
[String]$GroupName
)
If($UserSID){
$Response.SetContentType('text/plain')
#$Body = [System.Web.HttpUtility]::UrlDecode($Request.BodyString)
$Response.Send(($Request.BodyString))
Param(
[String]$GroupName = "administrators"
)
html {
head {
title 'Local User Manager'
@Stephanevg
Stephanevg / Get-GitLabCIVariableValues.ps1
Last active May 6, 2019 10:42
List all Gitlab variables
Function Get-GitLabCIVariableValues {
$Standardvariables = Get-Variable | ? {$_.Name -like "CI*" -or $_.Name -like "*GITLAB_*"}
#$NonStandardVariables = Get-Variable -Name "RESTORE_CACHE_ATTEMPTS","CHAT_INPUT","CHAT_CHANNEL","GET_SOURCES_ATTEMPTS","ARTIFACT_DOWNLOAD_ATTEMPTS"
$return = $Standardvariables #+ $NonStandardVariables
return $return
}
$FullLocalRepoPath = (Get-Variable -Name CI_PROJECT_DIR -ValueOnly).Replace("/","\")
@Stephanevg
Stephanevg / CreateRepository.Class.ps1
Last active April 24, 2019 11:34
Create a Folder repository (With Share etc...)
Class Repository {
[System.IO.DirectoryInfo]$RootPath
[System.IO.DirectoryInfo[]]$Subfolders
Repository([String]$RootPath,[String[]]$SubFolders){
$this.RootPath = $RootPath
$this.AddSubFolder($SubFolders)
}