Skip to content

Instantly share code, notes, and snippets.

<#
.Synopsis
Formatting your T-SQL code
.DESCRIPTION
Formatting T-SQL code through RedGate Format Api (https://www.red-gate.com/products/sql-development/sql-prompt/)
Works on PowerShell Core (aka PowerShell 6+)
.EXAMPLE
$Script = '--(Query 16)_(AlwaysOn AG Cluster)
SELECT cluster_name, quorum_type_desc, quorum_state_desc
<RDCMan programVersion="2.7" schemaVersion="3">
<file>
<credentialsProfiles>
<credentialsProfile inherit="None">
<profileName scope="Local">1</profileName>
<userName />
<password />
<domain />
</credentialsProfile>
</credentialsProfiles>
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
& choco --version
choco.exe
# try {
# try {
# & choco --version
# }
<#
.SYNOPSIS
The function creates the profile and connects to wifi.
.DESCRIPTION
The function creates the profile and connects to wifi.
.EXAMPLE
PS C:\> Connect-ToWifi -SsidName 'WifiTest'
# Supply values for the following parameters:
name: Publish PowerShell module
# Ustawiamy, kiedy przepływ zostanie uruchomiona.
# Wyzwalaczem będzie push do gałęzi master
on:
push:
branches: [master]
# Definiujemy jeden lub więcej zadań
jobs:
<#
https://azure.microsoft.com/en-us/pricing/details/logic-apps/
Actions $0.000025
Standard Connector $0.000125
Enterprise Connector $0.001
.EXAMPLE
Get-LogicAppEstimatedCost -Path C:\Temp\logicapp.json
Object Name Type Cost
function Get-OtodomSprzedaz
{
#Requires -Version 3.0
param(
[Parameter(Mandatory)]
[String[]]$Url
)
begin
{
$regex = '\d+'
{
// the file explorer by sorting your files by type or recent changes
"explorer.sortOrder": "default",
// editor
"editor.formatOnType": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabCompletion": "on",
"editor.mouseWheelZoom": true,
"editor.fontFamily": "MesloLGM Nerd Font, Consolas, 'Courier New', monospace",
<Configuration>
<VGpu>Disable</VGpu>
<Networking>Enable</Networking>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Users\Lenovo\Skrypty\PowerShell</HostFolder>
<ReadOnly>true</ReadOnly>
</MappedFolder>
<MappedFolder>
<HostFolder>C:\Users\Lenovo\Skrypty\Sandbox\out</HostFolder>
# install chocolatey
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# install app
& choco install vscode -y
# copy vscode settings
New-Item "C:\users\WDAGUtilityAccount\AppData\Roaming\Code\User" -ItemType Directory
Copy-Item "C:\users\WDAGUtilityAccount\Desktop\User\*" -Destination "C:\users\WDAGUtilityAccount\AppData\Roaming\Code\User" -Recurse -Force -Container