Skip to content

Instantly share code, notes, and snippets.

View eizedev's full-sized avatar
💻
Automating everything - Picture powered by AI with my photo as model.

René eizedev

💻
Automating everything - Picture powered by AI with my photo as model.
  • Germany
  • 05:31 (UTC +02:00)
View GitHub Profile
@eizedev
eizedev / powershell-template.code-workspace
Last active May 4, 2020 08:53
powershell-template.code-workspace - VSCode Template for working with different styling guidelines for different repositories. Save this file to your desired repository and change the file according to your needs. Finaly open (File - Open Workspace) this VSCode workspace in VSCode..
{
"folders": [{
"path": "."
}],
"settings": {
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.openBraceOnSameLine": true,
"powershell.codeFormatting.useCorrectCasing": true
}
}
@eizedev
eizedev / Set-AccountPasswordRemote
Last active March 12, 2020 08:23
Change your own Active Directory password from PowerShell without any special permissions in a remote domain
$domain = "domain name"
$username = "user name"
$User = $username + "@" + $domain
$Password = (Read-Host -asSecureString "Enter the current password")
$Credential = New-Object System.Management.Automation.PSCredential ($User, $Password)
Set-ADAccountPassword -Credential $Credential -Server $domain -Identity $userName -OldPassword $Password -NewPassword (Read-Host -asSecureString "Enter the new password")
@eizedev
eizedev / New-GithubGist.ps1
Created January 9, 2020 08:58 — forked from jdhitsolutions/New-GithubGist.ps1
A PowerShell script to create a new gist on Github.
#requires -version 4.0
Function New-GitHubGist {
[cmdletbinding(SupportsShouldProcess,DefaultParameterSetName = "Content")]
Param(
[Parameter(Position = 0, Mandatory, HelpMessage = "What is the name for your gist?",ValueFromPipelineByPropertyName)]
[ValidateNotNullorEmpty()]
[string]$Name,
@eizedev
eizedev / 1-Get-DockerDiskUsage.ps1
Last active January 9, 2020 07:48 — forked from jdhitsolutions/1-Get-DockerDiskUsage.ps1
A Powershell function that wraps Docker command line output to display disk usage. Save the files without the numeric prefix.
#requires -version 5.1
Function Get-DockerDiskUsage
{
[cmdletbinding()]
[alias("gddu")]
[OutputType("Get-DockerDiskUsage.DockerDiskUsage")]
Param(
[Parameter(Position = 0, HelpMessage = "Get specific usage types. The default is All")]
[ValidateSet("Images", "Containers", "Volumes", "Cache")]
Function Get-GitSize {
<#
.SYNOPSIS
Get the size of .git folder
.DESCRIPTION
When using git, it creates a hidden folder for change tracking. Because the file is hidden it is easy to overlook how large it might become. Specify the parent folder path. The result displays the size value in bytes but there are additional properties that show the value formatted in KB, MB or GB.
.PARAMETER Path
The path to the parent folder, not the .git folder.
.EXAMPLE
PS C:\scripts\PiedPiperBox> Get-GitSize
@eizedev
eizedev / Get-GitConfig.ps1
Created January 9, 2020 07:38 — forked from jdhitsolutions/Get-GitConfig.ps1
A PowerShell function to get your git configuration. See comment based help for usage examples.
#requires -version 5.1
Function Get-GitConfig {
<#
.SYNOPSIS
Get git configuration settings
.DESCRIPTION
Git stores configurations settings in a simple text file format. Fortunately, this file is structured and predictable. This command will process git configuration information into PowerShell friendly output.
.PARAMETER Scope
@eizedev
eizedev / mydockercontainer.format.ps1xml
Created January 9, 2020 07:27 — forked from jdhitsolutions/mydockercontainer.format.ps1xml
A PowerShell format file to be used with my Get-DockerContainer function.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<ViewDefinitions>
<View>
<!--Created 03/27/2019 17:01:10 by BOVINE320\Jeff-->
<Name>default</Name>
<ViewSelectedBy>
<TypeName>Get-DockerContainer.myDockerContainer</TypeName>
</ViewSelectedBy>
<GroupBy>
@eizedev
eizedev / Get-DockerContainer.ps1
Last active January 9, 2020 07:30 — forked from jdhitsolutions/Get-DockerContainer.ps1
A PowerShell function to get docker containers as objects.
#requires -version 5.1
<#
sample usage
get-dockercontainer
get-dockercontainer | select *
get-dockercontainer -all | format-table -view stats
#>
Function Get-DockerContainer
@eizedev
eizedev / Update-VMTools.ps1
Created July 19, 2019 09:47
Update VMware Guest OS VMTools on all VMs which need and Upgrade and have a windows guest os
@(Get-VM).Where( {$_.ExtensionData.Guest.ToolsVersionStatus -eq "guestToolsNeedUpgrade" -and $_.PowerState -eq "PoweredOn"}) | Get-VMGuest | Where-Object {$_.GuestFamily -eq "windowsGuest" } | Update-Tools -NoReboot -RunAsync
@eizedev
eizedev / gist:038931996db61064b263332ad0d038ab
Created June 28, 2019 10:00 — forked from jstangroome/gist:3087453
Change your own Active Directory password from PowerShell without any special permissions
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword')