This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem "C:\Users\Tim\Desktop\DL\uCommerce\8e0acd5c-f842-49db-933d-cc9e61fcff51\bin" -Filter *.dll.* | ` | |
Foreach-Object{ | |
Rename-Item $_.FullName ([io.fileinfo]$_.FullName).basename | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forfiles -p "< Path To Folder >" -s -m *.* /D -< Number of days ago > /C "cmd /c del @path" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @cols NVARCHAR(max), @ContentTypeId int | |
SET @ContentTypeId = 1074 | |
SELECT @cols = STUFF(( | |
SELECT DISTINCT TOP 100 PERCENT | |
'],[' | |
+ CONVERT(varchar, Name + ' (' + CONVERT(varchar, id) + ')', 255) | |
FROM | |
dbo.cmsPropertyType | |
WHERE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Delete Old Document Versions */ | |
Declare @keepOldVersionsCount int, @keepNewerThanDate datetime | |
Set @keepOldVersionsCount = 0 /* 0 Keeps published and newest only. */ | |
Set @keepNewerThanDate = getdate() /* getDate() or '2013-01-01' */ | |
IF OBJECT_ID('tempdb..#versions') IS NOT NULL DROP TABLE #versions | |
SELECT VersionID, nodeId, updateDate, newest, published INTO #versions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM [TableX] | |
ORDER BY [FieldX] | |
OFFSET 501 ROWS | |
FETCH NEXT 100 ROWS ONLY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 100 | |
* | |
FROM | |
uCommerce_CampaignItem ci | |
LEFT JOIN uCommerce_Target t ON ci.CampaignItemId = t.CampaignItemId | |
LEFT JOIN uCommerce_VoucherTarget vt ON t.TargetId = vt.VoucherTargetId | |
LEFT JOIN uCommerce_ProductTarget pt ON t.TargetId = pt.ProductTargetId | |
WHERE | |
ci.Name = 'Campaign Item Name' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpWebRequest request = WebRequest.Create(i_Uri) as HttpWebRequest; | |
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate"); | |
response = request.GetResponse() as HttpWebResponse; | |
If(response.Headers.ToString().IndexOf("gzip") != -1) | |
{ | |
//unzip; | |
} | |
private static void DecompressGzipStream(Stream i_GzipStream) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var names = name.Trim().Split(new[] { ' ' }, 2); | |
string firstName; | |
string lastName; | |
if (names.Length == 1) | |
{ | |
firstName = String.Empty; | |
lastName = names[0]; | |
} | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var enumerateMe = originalList.Select((item, index) => new { Position = index, Item = item }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get-website | select name,id,state,physicalpath, | |
@{n="Bindings"; e= { ($_.bindings | select -expa collection) -join ';' }} , | |
@{n="LogFile";e={ $_.logfile | select -expa directory}}, | |
@{n="attributes"; e={($_.attributes | % { $_.name + "=" + $_.value }) -join ';' }} | | |
Export-Csv -NoTypeInformation -Path d:\my_list.csv |