Skip to content

Commit

Permalink
Ps wrapper branch merge 2 (#9)
Browse files Browse the repository at this point in the history
* Committing python file cleaning logic.

* Storing changes to utils and transfer_objects.py

* New File

* Changed logic to be comma seperated list driven on input for UpdateFiles.ps1

* powershell_working_branch

* update Help

* added OutputDirectory logic

* Updated TransferObjects.ps1 with full logic suite.

* Updating to plural objects for transfer and update.

* Fixed bug in Worksheets logic

* Transfer Objects Update.

* TransferObjects.ps1 and UpdateFiles.ps1 Working With Worksheets.

* Added cleanup stmt for review.

* Removed python logic, added filter todo.

* Fixed indenting

* Final feature commit ps_wrapper_branch.

* Update manifest to include new modules

* consolidate TransferObjects with Transfer-SFObjects

* Updated to exclude filters

* Added new functions and version number for new build

* Last feature commit release 6.29.2022

* filter logic non global assets working.

* Download-SFBinaries installer v.1.0

* Working latest binaries import

* Updating Readme: Download-SFBinaries Example

* Updated Download-SFBinaries.ps1 with -Verbose and Get-Command -Module SnowflakePS check.

* Updated with download_path var for different os systems. Needs to be tested on linux and windows.

* Download-SFBinaries.ps1

* Removed os dir element.

Co-authored-by: sfc-gh-mybarra <michael.ybarra@snowflake.com>
  • Loading branch information
sfc-gh-rbacastow and sfc-gh-mybarra authored Jun 30, 2022
1 parent df91a13 commit e5e78e6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Download-SFBinaries.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$version_number = Read-Host -Prompt "`r`nWhat version of the binaries do you want to install? (Hit enter to get the latest binaries)"

if ($version_number -eq ''){
Write-Host "`r`nSearching https://api.github.com/repos/Snowflake-Labs/sfsnowsightextensions/releases/latest for latest binaries...`r`n" -ForegroundColor Cyan
$requestData = Invoke-WebRequest -Uri "https://api.github.com/repos/Snowflake-Labs/sfsnowsightextensions/releases/latest"
$releases = ConvertFrom-Json $requestData.content
$version_number = $releases.tag_name
Write-Host "Found latest release: $version_number`r`n" -ForegroundColor Cyan
}

Do { $os = Read-Host -Prompt "Which os are you downloading the binaries for? Use osx, win, or linux" }
while ('osx', 'win', 'linux' -notcontains $os )

if ($os -eq 'win'){
$download_path = "$home/Downloads"
}
else {
$download_path = '~/Downloads'
}

Write-Host "`r`nAttempting to download file if it exists at https://github.com/Snowflake-Labs/sfsnowsightextensions/releases/download/$version_number/SnowflakePS.$os.$version_number.zip`r`n" -ForegroundColor Cyan

curl "https://github.com/Snowflake-Labs/sfsnowsightextensions/releases/download/$version_number/SnowflakePS.$os.$version_number.zip" -O --output-dir ~/Downloads -o -J -L

Expand-Archive "$download_path/SnowflakePS.$os.$version_number.zip" -DestinationPath "~/Downloads/SnowflakePS.$os.$version_number" -Force

Import-Module "$download_path/SnowflakePS.$os.$version_number/SnowflakePS.psd1" -Force -Verbose

Get-Command -Module SnowflakePS
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Senior Solution Architect at Snowflake Professional Services.
# Install
All binaries are located in [Releases](https://github.com/Snowflake-Labs/sfsnowsightextensions/releases)

##### NOTE: You can use the [Download-SFBinaries](https://github.com/Snowflake-Labs/sfsnowsightextensions/Download-SFBinaries.ps1) file to automate the download and setup of your session like so:

```pwsh
pwsh -File ./Download-SFBinaries.ps1
```

## Install PowerShell
Install Powershell 7 from [Powershell GitHub Releases](https://github.com/PowerShell/PowerShell/releases) or [Powershell Landing page](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell).

Expand Down

0 comments on commit e5e78e6

Please sign in to comment.