This file contains hidden or 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
| function Get-Tablebases | |
| { | |
| [CmdletBinding()] | |
| param ( | |
| [int] | |
| [ValidateScript({ $_ -ge 3 },ErrorMessage = "'{0}' is not a valid number of pieces")] | |
| [Parameter(HelpMessage = "The maximum number of pieces whose tablebases you want to download.")] | |
| $MaxPieces = 7, | |
| [string] | |
| [ValidateScript({ Test-Path -Path $_ -PathType Container }, ErrorMessage = "Cannot find install path '{0}' because it does not exist.")] |
This file contains hidden or 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-Service -DisplayName "*Network Virtualization*" | Restart-Service -Force -Verbose | |
| Get-Service -DisplayName "*Virtual Disk*" | Restart-Service -Force -Verbose | |
| Get-Service -DisplayName "*Virtual Machine*" | Restart-Service -Force -Verbose | |
| Get-Service -DisplayName "*Host Compute*" | Restart-Service -Force -Verbose | |
| Get-Service -DisplayName "*Container Manager*" | Restart-Service -Force -Verbose | |
| Get-Service -DisplayName "*Remote Procedure*" | Where-Object { $_.Status -eq [System.ServiceProcess.ServiceControllerStatus]::Stopped } | Start-Service -Verbose | |
| Get-Service -DisplayName "*Application Guard*" | Where-Object { $_.Status -eq [System.ServiceProcess.ServiceControllerStatus]::Stopped } | Start-Service -Verbose |
This file contains hidden or 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
| # 1. Execute certificate-ripper (crip.exe) to fetch Maven Central's TLS/SSL certificates. | |
| # It resolves the Certificate Authority chain (--resolve-ca) and exports them in DER format into the TEMP folder. | |
| &"$env:LOCALAPPDATA\Programs\certificate-ripper\crip.exe" export der --destination="$env:TEMP\certs\" --resolve-ca --url="https://repo.maven.apache.org/maven2" | |
| # 2. Gather all the downloaded certificate files from the temporary destination folder. | |
| $certs = Get-ChildItem -Path "$env:TEMP\certs\" | |
| # 3. Locate all instances of 'java.exe' installed on the machine across your environment PATH variable. | |
| Get-Command -Name java -All | ForEach-Object { | |
This file contains hidden or 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
| using System; | |
| using System.IO; | |
| using System.Net.Http; | |
| using System.Security.Cryptography; | |
| using System.Xml; | |
| namespace SaxonicaDownloader | |
| { | |
| class Program | |
| { |
This file contains hidden or 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
| $queries = 0..25 | |
| Set-Variable -Name SecondsPerQuery -Value 11 -Option ReadOnly -Force | |
| Set-Variable -Name Variability -Value 0.07 -Option ReadOnly -Force | |
| $queries | ForEach-Object -Begin { | |
| $averageSecondsPerQuery = $SecondsPerQuery # Average seconds per query will be used to predict the time per iteration | |
| } -Process { | |
| $index = $_ | |
| $timing = [timespan]::FromSeconds((Get-Random -Minimum ((1.00 - $Variability) * $SecondsPerQuery) -Maximum ((1.00 + $Variability) * $SecondsPerQuery))) | |
| $averageSecondsPerQuery = $averageSecondsPerQuery * ($index / $queries.Length) + $timing.TotalSeconds * ($queries.Length - $index) / $queries.Length | |
| [pscustomobject]@{ |
This file contains hidden or 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
| function Move-AzStorageBlob { | |
| #Requires -Modules Az.Storage | |
| [CmdletBinding(ConfirmImpact = 'High', SupportsShouldProcess)] | |
| param ( | |
| [Parameter(Mandatory)] | |
| [System.Object] | |
| $SrcBlob, | |
| [Parameter(Mandatory)] | |
| [string] | |
| $SrcContainer, |
This file contains hidden or 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
| $sqlclDownload = Invoke-RestMethod -Uri "https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/download/" | |
| $sqlclDownloadHash = ($sqlclDownload | Select-String -Pattern "SHA256: (?<sha256>[^<]+)" | Select-Object -ExpandProperty Matches).Groups['sha256'].Value | |
| $sqlclDownloadUri = ($sqlclDownload | Select-String -Pattern "https:.*\.zip" | Select-Object -ExpandProperty Matches).Value | |
| Invoke-WebRequest -Uri $sqlclDownloadUri -OutFile $env:TEMP\sqlcl.zip | |
| if(Get-FileHash -Path $env:TEMP\sqlcl.zip | ForEach-Object { $_.Hash -ieq $sqlclDownloadHash }){ | |
| Expand-Archive -Path $env:TEMP\sqlcl.zip -DestinationPath $env:LOCALAPPDATA\Programs\ -Force | |
| } |
This file contains hidden or 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
| function ConvertTo-TnsnamesOra | |
| { | |
| [CmdletBinding(DefaultParameterSetName = 'PipelineStringArray')] | |
| param | |
| ( | |
| [Parameter(ParameterSetName = 'ConnectionsJsonPath')] | |
| [String]$ConnectionsJsonPath = "$env:APPDATA\SQL Developer\system*\o.jdeveloper.db.connection\connections.json", | |
| [Parameter(ParameterSetName = 'PipelineStringArray', ValueFromPipeline, ValueFromPipelineByPropertyName = $true)] | |
| [ValidateScript({ $null -ne $_ -and $null -ne ($_ | ConvertFrom-Json -Depth 99) }, ErrorMessage = 'The input string is not valid JSON.')] | |
| [string[]]$ConnectionsJsonStrArray, |
This file contains hidden or 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
| function Move-AzStorageBlob { | |
| #Requires -Modules Az.Storage, Az.Accounts | |
| [CmdletBinding()] | |
| param ( | |
| $SrcBlob, | |
| $SrcContainer, | |
| $DestContainer, | |
| $DestBlob, | |
| $Context | |
| ) |
This file contains hidden or 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
| function Get-DecryptedPassword { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(ValueFromPipelineByPropertyName)] | |
| [securestring] | |
| $EncryptedPassword = (Get-Content -Path 'C:\Users\B0649033\AppData\Roaming\SQL Developer\system*\o.jdeveloper.db.connection\connections.json' | ConvertFrom-Json | ForEach-Object { $_.connections.info } | Out-ConsoleGridView -Title "Choose connection" -OutputMode Single | ConvertTo-SecureString -AsPlainText -Force ), | |
| [Parameter(ValueFromPipelineByPropertyName)] | |
| [string] | |
| $DbSystemId = (([xml]$(Get-Content -Path "$env:APPDATA\SQL Developer\system*\o.sqldeveloper\product-preferences.xml")) | ForEach-Object { $_.preferences.value } | Where-Object -FilterScript { $_.n -eq 'db.system.id' } | Select-Object -ExpandProperty v -Unique -First 1) | |
| ) |
NewerOlder