Skip to content

Instantly share code, notes, and snippets.

View imtrinity94's full-sized avatar
💭
Blogging

Mayank Goyal imtrinity94

💭
Blogging
View GitHub Profile
$vcloudhost = ""
# Load cloud module from VMware
try {import-module VMware.VimAutomation.Cloud} catch {}
# Connect to
connect-ciserver $vcloudhost
# Get all organisations
$orgs = get-org
@imtrinity94
imtrinity94 / qip_provision_ip.py
Last active November 30, 2021 07:04 — forked from ryancurrah/qip_provision_ip.py
Allocate an IP Address using VitalQIP SOAP API
#!/usr/bin/env python
import argparse
import re
import uuid
import sys
from xml.dom import minidom
from xml.parsers.expat import ExpatError
try:
@imtrinity94
imtrinity94 / getHostCDPInfo_Task.js
Created December 29, 2021 09:28 — forked from chelnak/getHostCDPInfo_Task.js
vRO task to get CDP information of a vsphere host and send email
//input: userEmail [String]
//input: vmHost [VC:Host]
var csv = ""
// Setup Mail Client
var message = new EmailMessage();
message.smtpHost = "smtp-host@org.co.uk";
message.fromName = "vCenter Orchestrator";
message.fromAddress = "noreply@org.co.uk";
@imtrinity94
imtrinity94 / notes.ps1
Created February 18, 2022 10:51 — forked from JoeKleinsorge/notes.ps1
My note taking helper
<#
.SYNOPSIS
A way for me to organize and add functionality to my note taking.
.DESCRIPTION
Allows the user to create a new note in VS Code automatically named the current month_day_year if no other inputs are used.
Allows the user to specify the name of the new note with the "-name" parameter, if a note with that name is already created in the directory, then it will open that note.
Allows the user to create a "week" note if the "-week" switch is used, this combines all the notes that were edited in the last week into one note.
Allows the user to create a "year" note if the "-year" switch is used, this combines all the notes that were edited in the last year into one note.
Allows the user to search through all notes in the directory for a string pattern match when the "-search" parameter is used.
@imtrinity94
imtrinity94 / vsphere_info.py
Created February 22, 2022 12:44 — forked from deviantony/vsphere_info.py
VMWare Vsphere info in Python using pyvmomi
#!/usr/bin/env python
import pyVmomi
import argparse
import atexit
import itertools
from pyVmomi import vim, vmodl
from pyVim.connect import SmartConnect, Disconnect
import humanize
@imtrinity94
imtrinity94 / parseVroConfigElement.py
Created March 28, 2022 07:35 — forked from dlinsley/parseVroConfigElement.py
Parse strings from an exported vRO Configuration Element with Python
#!/usr/bin/env python3
import argparse
import json
import sys
import xml.etree.ElementTree as ET
parser = argparse.ArgumentParser('Parse strings from exported vRO Configuration Element XML')
parser.add_argument('FILE',help='ConfigElement XML file path')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('-n','--name',dest='vroAttribute',help='Attribute Name to parse')
@imtrinity94
imtrinity94 / vROCertTool_package_signing_cert_generation.md
Last active April 20, 2022 15:06 — forked from dlinsley/vRO_package_signing_cert_generation.md
vROCertTool - Package Singing Certificate generation

Package Signing Certificate Generation

Package signing certificate keystores can be created using the keytool command provided by the JDK.

To Create a self signed certificate for package signing that is good for 10 years:

keytool -genkeypair \
-alias _dunesrsa_alias_ \
-keyalg RSA \
-keysize 2048 \
Name Value
---- -----
SHLVL 1
HOME /root
PATH /usr/lib/powershell:/usr/local/sbin:/usr/local/…
HOSTNAME vco-app-597755d9d-knm7s
_ /usr/bin/pwsh
VCO_FID 3625bbe8-001d-40c8-92be-c7f2da18e391
NO_PROXY *.local,*.localdomain,localhost,10.244.*,192.16…
PWD /run/vco-polyglot
<#
In order to test it, you need to get vsphere SDK for webservices, as this is using the libraries from it.
new-webserviceproxy can't handle soap security headers. You also need PKCS#12 pfx certificate (in my example)
#>
#https://www.dorkbrain.com/docs/2017/09/02/gzip-in-powershell/
Function ConvertTo-GZipString () {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True)]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.