Export Slack Channel Files and update Slack JSON for use with slack2html
- Export your workspace data from Slack. This involves using the Slack GUI to (a) initiate the export process, then (b) click a link to download a ZIP file containing your workspace data.
- Extract the contents of the ZIP file into an empty folder on your computer (e.g.
C:\Temp\slack\exported-data
).
- Launch PowerShell.
- Clone this repository onto your computer.
PS> git clone https://github.com/jwts-dev/slack-history.git
Note: In case you don't have Git installed, you can, instead, download the contents of the main branch of the repository as a ZIP file, then extract its contents.
- Navigate into the root folder of the repository.
PS> cd .\slack-history\
- Open the script file (i.e.
Slack_Export_Channel_Files.ps1
) in a text editor. - Edit the value of the
$ExportPath
variable (currently defined on line 1) to contain the path to the root folder of the data you exported from Slack earlier.- $ExportPath = ".\slackHistory" + $ExportPath = "C:\Temp\slack\exported-data"
Note: If you don't edit the value, the script will look for exported Slack data in the following folder:
.\slackHistory
- Edit the following line of code (currently line 19) as shown below.
- $channelList = Get-Content -Raw -Path .\slackHistory\channels.json | ConvertFrom-Json + $channelList = Get-Content -Raw -Path "$ExportPath\channels.json" | ConvertFrom-Json
Note: If you don't edit the line, the script will look for the exported Slack channel list in the following folder:
.\slackHistory
Note: This change may eventually be incorporated into the authoritative script, rendering this manual step unnecessary. For now, though, it is necessary.
- Save the changes to the file.
- Run the script (in a way that bypasses PowerShell's execution policy).
PS> PowerShell.exe -ExecutionPolicy Bypass -File .\Slack_Export_Channel_Files.ps1
When the script finishes running, it will print a message that says "Exiting
" and the PowerShell prompt will reappear.