Skip to content

Instantly share code, notes, and snippets.

@PCfromDCSnippets
Last active January 5, 2016 18:16
Show Gist options
  • Save PCfromDCSnippets/838dfc352e0b1b66f3ad to your computer and use it in GitHub Desktop.
Save PCfromDCSnippets/838dfc352e0b1b66f3ad to your computer and use it in GitHub Desktop.
Module Import and Variables
Import-Module SQLPS -DisableNameChecking -EA 0
$dbName = "deleteme" # Database Name
$mdfNewLocation = "G:\Data" # Where the .mdf file will be moved to
$ldfNewLocation = "H:\Logs" # Where the .ldf file will be moved to
$sqlSA = "sqlSA" # The SQL SA Account username
$domain = $env:USERDOMAIN
$sqlSA = $domain + "\" + $sqlSA # Converts the SA account from username to Account Name (domain\username)
$location = Get-Location # Gets current location to return at the end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment