Skip to content

Instantly share code, notes, and snippets.

@potatoqualitee
Last active December 11, 2018 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potatoqualitee/ce741a4cd35be974785650792d0d0a76 to your computer and use it in GitHub Desktop.
Save potatoqualitee/ce741a4cd35be974785650792d0d0a76 to your computer and use it in GitHub Desktop.
publisher
Set-Content -Encoding UTF8 -Path C:\github\dbatools\allcommands.ps1 -Value "### DO NOT EDIT THIS FILE DIRECTLY ###"
Get-ChildItem -Path "C:\github\dbatools\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1
Get-ChildItem -Path "C:\github\dbatools\internal\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1
Remove-Item -Path C:\github\dbatools\allcommands.zip -ErrorAction Ignore
Compress-Archive -Path C:\github\dbatools\allcommands.ps1 -DestinationPath C:\github\dbatools\allcommands.zip
Remove-Item -Recurse C:\github\dbatools\allcommands.ps1 -ErrorAction Ignore
Remove-Item -Recurse C:\gallery -Force
mkdir C:\gallery\dbatools
robocopy c:\github\dbatools C:\gallery\dbatools /S /XF *.psproj* *.git* *.yml /XD .git .github Tests .vscode | Out-String | Out-Null
Remove-Item -Recurse C:\gallery\dbatools\bin\build -ErrorAction Ignore
Remove-Item -Recurse C:\gallery\dbatools\bin\projects -ErrorAction Ignore
Remove-Item -Recurse C:\gallery\dbatools\bin\StructuredLogger.dll -ErrorAction Ignore
Set-AuthenticodeSignature -FilePath C:\gallery\dbatools\dbatools.psd1 -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\thumbprint) -TimestampServer http://timestamp.digicert.com
Set-AuthenticodeSignature -FilePath C:\gallery\dbatools\dbatools.psm1 -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\thumbprint) -TimestampServer http://timestamp.digicert.com
Set-AuthenticodeSignature -FilePath C:\gallery\dbatools\xml\dbatools.Format.ps1xml -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\thumbprint) -TimestampServer http://timestamp.digicert.com
Set-AuthenticodeSignature -FilePath C:\gallery\dbatools\install.ps1 -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\thumbprint) -TimestampServer http://timestamp.digicert.com
Set-AuthenticodeSignature -FilePath C:\gallery\dbatools\xml\dbatools.Types.ps1xml -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\thumbprint) -TimestampServer http://timestamp.digicert.com
#Set-AuthenticodeSignature -FilePath C:\gallery\dbatools\allcommands.ps1 -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\thumbprint) -TimestampServer http://timestamp.digicert.com
Publish-Module -Path C:\gallery\dbatools -NuGetApiKey xyz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment