Skip to content

Instantly share code, notes, and snippets.

<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+'
# 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
<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>
if([System.Environment]::OSVersion.Version.Build -gt 18305)
{
Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -Online -ErrorAction Stop -NoRestart
}
# Restart-Computer -Force
# PowerShell 7 - &&
ping 8.8.8.8 && Write-Output "Host found"
# Example 2
New-Item -Path (Join-Path $pwd -ChildPath 'file.txt') -Value "test" && Get-Content -Path(Join-Path $pwd -ChildPath 'file.txt')
# PowerShell 7 - ||
ping powershell.io || Write-Output "Host not found"