Skip to content

Instantly share code, notes, and snippets.

View mohamedibrahim93's full-sized avatar

Mohamed Ibrahim mohamedibrahim93

View GitHub Profile
@mohamedibrahim93
mohamedibrahim93 / exec-sql-queries.ps1
Created May 29, 2023 15:11
exec sql queries in folder
$connectionString = ""
$rootPath = "./source"
$watch = [System.Diagnostics.Stopwatch]::StartNew()
"Staring Process..."
"----------------------------"
@mohamedibrahim93
mohamedibrahim93 / GenerateSQLBackup.ps1
Last active September 29, 2022 11:40
Generate SQL Backup Script Using Powershell
$srvname="localhost"
$dbname="Coderush"
$dbusername="sa"
$dbpassword="123"
$scriptFileName= "D:\PSScripts\Test.sql"
$dbobjects = @(
"dbo.Product",
"dbo.VW_Users",
@mohamedibrahim93
mohamedibrahim93 / ImportWizardFromFiles.ps1
Last active December 21, 2022 12:03
Sitecore: Import content from a Excel or CSV using Sitecore PowerShell Extensions with many languages.
<#
.SYNOPSIS
Data Import Wizard provides a way to generate or update content from an external file.
.DESCRIPTION
The import file uses the properties "Name" and "Id" to help match existing items.
.NOTES
Mohamed AL-Driny - https://github.com/mohamedibrahim93
#>
@mohamedibrahim93
mohamedibrahim93 / ImportWizardFromExcel.ps1
Last active September 6, 2022 13:08
Sitecore: Import content from a Excel using Sitecore PowerShell Extensions with many languages.
<#
.SYNOPSIS
Data Import Wizard provides a way to generate or update content from an external file.
.DESCRIPTION
The import file uses the properties "Name" and "Id" to help match existing items.
.NOTES
Mohamed AL-Driny - https://github.com/mohamedibrahim93
#>
@mohamedibrahim93
mohamedibrahim93 / SearchInAllDBObjects.sql
Created September 4, 2022 08:52
SQL: Search In All DB Objects
DECLARE @search nvarchar ( 200 )
SET @search = 'dbo'
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc
FROM
sys.sql_modules m
INNER JOIN sys.objects o ON m.object_id = o.object_id
WHERE
m.definition LIKE '%' + @search + '%'
@mohamedibrahim93
mohamedibrahim93 / StructAsEnumBehavior.cs
Created September 4, 2022 08:51
.Net: struct as enum behavior.cs
public struct Constants
{
public string Value { get; }
private Constants(string value)
{
Value = value;
}
public override string ToString()
{
return Value;
@mohamedibrahim93
mohamedibrahim93 / ImportWizardFromCSV.ps1
Last active September 6, 2022 13:08
Sitecore: Import content from a CSV using Sitecore PowerShell Extensions with many languages.
<#
.SYNOPSIS
Data Import Wizard provides a way to generate or update content from an external file.
.DESCRIPTION
The import file uses the properties "Name" and "Id" to help match existing items.
.NOTES
Mohamed AL-Driny - https://github.com/mohamedibrahim93
#>