This will describe how I am using Github to sync and update my powershell profile (note however that this is probably not best practice since I will be loading scripts from the internet. Do not just copy and paste)
This script will create/overwrite the existing three profiles for PS7, PS5 and ISE
# Create profile for both PS Core, PS and ISE
$PS7path = "C:\Users\$ENV:USERNAME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"
$PS5path = "C:\Users\$ENV:USERNAME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"
$PS5ISEpath = "C:\Users\$ENV:USERNAME\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1"
New-Item -Path $PS7path -Force
New-Item -Path $PS5path -Force
New-Item -Path $PS5ISEpath -Force