mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
* Connect(Setup): Fix indent (using Visual code Formatter) * Setup(Functions): Fix indent (using Visual Code Formatter) * Support(Setup): Fix indent (using Visual Code Formatter) * InvokeNetboxRequest(Helpers): Fix indent (using Visual Code Formatter) * Add Set-netboxCipherSSL for enable TLS1.1 and TLS1.2 (for PS 5.0) From PowerAruba/FortiPower Module :) * Add Set-NetboxUnstrustedSSL for disable SSL chain test (for PS 5.0 From PowerAruba/FortiPwoer Module :) * Add Get/Set netboxInvokeParms for Get and Set Invoke Params (array) Like -SkipCertificate, Timeout... * InvokeNetboxRequest: Add to Splat NetboxInvokeParams * Connect: Add SkipCertificateCheck parameter (for PS5 and Core) Also enable TLS 1.1 and 1.2 for PS5 * PSSA: Add Github Actions for launch PSSA (PowerShell Script Analyzer) when launch PR (#11) Add also vscode/PSScriptAnalyzerSettings.psd1 for Settings for PSSA (can be reuse also for vscode...) * Update psproj * Correct typo * Correct brace formatting * Add Get/Set timeout functions * Add Get/Set timeout functions * Add TimeoutSeconds parameter and logic to Connect-NetboxAPI - Updated `InvokeNetboxRequest` to use `NetboxConfig.Timeout` - Updated `Get-NetboxAPIDefinition` to use `NetboxConfig.Timeout` * Trim whitespaces * Add Get-NetboxVersion function * Remove API Definition caching and replace with Netbox version check * Increment version to 1.4 Co-authored-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Co-authored-by: Ben Claussen <claussen@neonet.org>
19 lines
No EOL
696 B
PowerShell
19 lines
No EOL
696 B
PowerShell
Function Set-NetboxUntrustedSSL {
|
|
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessforStateChangingFunctions", "")]
|
|
Param( )
|
|
# Hack for allowing untrusted SSL certs with https connections
|
|
Add-Type -TypeDefinition @"
|
|
using System.Net;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
public class TrustAllCertsPolicy : ICertificatePolicy {
|
|
public bool CheckValidationResult(
|
|
ServicePoint srvPoint, X509Certificate certificate,
|
|
WebRequest request, int certificateProblem) {
|
|
return true;
|
|
}
|
|
}
|
|
"@
|
|
|
|
[System.Net.ServicePointManager]::CertificatePolicy = New-Object -TypeName TrustAllCertsPolicy
|
|
|
|
} |