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
[Net.ServicePointManager]::ServerCertificateValidationCallback={$true} | |
#Directory where all files we want to upload | |
$Dir = Set-Location -Path Microsoft.PowerShell.Core\FileSystem::"D:\somepath" | |
#ftp server credential | |
$user = "someuser" | |
$pass = "somepass" | |
#Upload text files to ftp server directory |
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
#Directory where all files we want to upload | |
$Dir = Set-Location -Path Microsoft.PowerShell.Core\FileSystem::"somepath" | |
#ftp server | |
$ftp = "ftp://someip" | |
$user = "someuser" | |
$pass = "somepass" | |
$webclient = New-Object System.Net.WebClient |
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
$sqlServer = "someip or servername" | |
$sqlDB = "database" | |
$sqlTable = "table" | |
$uid = "sql id" | |
$pwd = "sql pw" | |
$sqlConn = New-Object System.Data.SqlClient.SqlConnection | |
$sqlConn.ConnectionString = "Server = $sqlServer; Database = $sqlDB; User ID = $uid; Password = $pwd;" | |
$sqlCmd = New-Object System.Data.SqlClient.SqlCommand | |
$sqlConn.Open() |
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
#Load SharePoint CSOM Assemblies | |
Add-Type -Path "C:\..\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\..\Microsoft.SharePoint.Client.Runtime.dll" | |
$sp_site = "sharepoint site" | |
$sp_list ="sharepoint list" | |
$ms_user = "username" | |
$ms_pass = ConvertTo-SecureString "password" -AsPlainText -Force | |
$sp_cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($ms_user, $ms_pass) | |
$context = New-Object Microsoft.SharePoint.Client.ClientContext($sp_site) |
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
let request = require('request').defaults({rejectUnauthorized: false}); | |
var user = 'some user'; | |
var pass = 'some pass'; | |
let url = 'some api url'; | |
let auth = 'Basic ' + new Buffer.from(user + ':' + pass).toString('base64'); | |
return new Promise(resolve => { | |
request({ |
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
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$first_flag = $true | |
Do { | |
#Data was too big so looping through required a cursor field added on to api url everytime. | |
If($first_flag) { | |
$params = @{ | |
Uri = 'https:// some api url' | |
Headers = @{'Authorization' = "Bearer bearer_id"} | |
Method = 'GET' | |
ContentType = 'application/json' |