Skip to content

Instantly share code, notes, and snippets.

cn cnromaine

  • cn romaine & associates
Block or report user

Report or block cnromaine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:bd8a85059d41e652fc3079e6f8b75efd
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Embedded C# Pad code example</title>
</head>
<body>
<pre>
<code class="codepad language-csharp" data-codepad="theme:cobalt" style="width:100%;height:400px;" >//
View Restoring DB .bak's
$path = (get-location).path
$files = get-childitem | where {$_.extension -eq ".bak"}
foreach($file in $files)
{
$dbPath = $path + '\' + $file
$dbName = $file.ToString().Replace(".bak", "")
write-host "Adding" $dbPath "to db " $dbName
Restore-SqlDatabase -ServerInstance "writeyourserverinstancehere" -Database $dbName -BackupFile $dbPath
}
@cnromaine
cnromaine / BuildingGuiApplicationInPowerSheel .ps
Last active Dec 21, 2015
From http://www.drdobbs.com/windows/building-gui-applications-in-powershell/240049898?pgno=2The Search-Twitter function returns an array of PowerShell objects with properties from the Twitter query. From that data, we extract the text of the tweet and the URL pointing to the Twitter user's profile image. If you look closely at the PowerShell cod…
View BuildingGuiApplicationInPowerSheel .ps
Import-Module .\ShowUI
function Search-Twitter ($q) {
$wc = New-Object Net.Webclient
$url = http://search.twitter.com/search.rss?q=$q
    ([xml]$wc.downloadstring($url)).rss.channel.item | select *
}
 
$ws = @{
    WindowStartupLocation = "CenterScreen"
    Width = 500
You can’t perform that action at this time.