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
/* WORKFLOW INPUTS
categoryPath | string | Category\Path of Configuration Element
configName | string | Name of Configuration Element
CSV_CONTENT | string | comman sperated content
----------------------------------------------
- KEY TYPE VALUE -
- username String root -
- password SecureString password -
- useCount number 14 -
- valid? boolean true -
@imtrinity94
imtrinity94 / Sort an array without changing place of negative numbers in Javascript.js
Last active February 22, 2022 12:35
Sort an array without changing place of negative numbers in Javascript
var arr = [999,-1,4,89,6,7,-99,-90]
for (var i = 0; i < arr.length ; i++){
for (var j = i; j< arr.length; j++){
if(arr[i] >= 0 && arr[j] >= 0 && arr[i]> arr[j]){
temp = arr[i]
arr[i]=arr[j]
arr[j]=temp
}
else if(arr[i]<0) i++
}
@imtrinity94
imtrinity94 / __tokenName in vRO .txt
Last active February 22, 2022 12:33
#vROTrick How to get a custom workflow token at each run in vRealize Orochestrator
* Simply edit the workflow you want to have a custom workflow token name : Add a __tokenName input
* Now in the presentation layer, add a "Show parameter input" set to false to hide it from showing up and a "Default value" with custom title (viz. workflow_name + name of the main input parameter and the user name)
* Save & close, test your workflow.
@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:
<#
Author: Mayank Goyal
Version: 1.0.0
Description:
- Doesn't work for Workflows and Resource Elements
- Get all content from exported vRO package Elements folder from .package file
- Run through each folder and read categories (Modules)
- Create a new file *.js from Actions
#>
@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";
// Input AD:User
user.setAttribute('lockoutTime','0');
return user;
@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 / Hangouts Chat incoming webhook quickstart.py
Created February 18, 2022 11:05
Hangouts Chat incoming webhook quickstart.py
from json import dumps
from httplib2 import Http
def main():
"""Hangouts Chat incoming webhook quickstart."""
url = '<INCOMING-WEBHOOK-URL>'
bot_message = {
'text' : 'Hello from a Python script!'}