Skip to content

Instantly share code, notes, and snippets.

@ffalor
ffalor / bolt_inventory.ps1
Created July 12, 2020 17:00
Powershell script to convert CSV to Bolt Inventory
$user = Read-Host -Prompt 'Input username'
$password = Read-Host -Prompt 'Input password'
$csv_path = Read-Host -Prompt 'Input path to inventory CSV'
$yaml_module = "powershell-yaml"
if ($null -eq (Get-InstalledModule -Name $yaml_module -ErrorAction SilentlyContinue)) {
Install-Module $yaml_module
}
@ffalor
ffalor / CreateMonoDscLayerZero.py
Last active October 20, 2020 15:12
Create a mono baseline file for Powershell Dsc
import csv
from pytablewriter import MarkdownTableWriter
DSC_FILE_NAME = "w2019MonoLayerZero.ps1"
CSV_FILE_NAME = "DSCResources.csv"
def mdtable(value_matrix):
"""
Generate Markdown table for resource.
if ! _resp="$(curl --retry 15 --retry-delay 10 -sf -H "Authorization: Bearer ${SSM_CS_AUTH_TOKEN}" -H "User-Agent: $userAgent" "$URL")" ; then
errcho "Failed getting url (exit status $?)..."
"$@"
echo "${_resp}"
echo _resp
fi
type osResource struct {
Bucket string
Object string
Generation int64
}
type Policy struct {
Cid string
LinuxInstallParams string
WindowsInstallParams string
"host_groups.UpdateGroupReqV1": {
"description": "A specific group to be updated",
"required": [
"id"
],
"properties": {
"assignment_rule": {
"description": "The new assignment rule of the group. Note: If the group type is static, this field cannot be updated manually",
"x-nullable": true,
"type": "string"
"schedule": schema.SingleNestedAttribute{
Optional: true,
Description: "Prohibit sensor updates during a set of time blocks.",
Attributes: map[string]schema.Attribute{
"timezone": schema.SetAttribute{
Required: true,
Description: "The time zones that will be used for the time blocks.",
},
"time_block": schema.SetNestedAttribute{
Required: true,