Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
显示
视图
拆分
统一
实时编辑器
隐藏空白更改
折叠未更改行
关闭换行
比对精度
智能
语法
无
更改外观
处理
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
powershell shell diff
创建于
7年前
差异永不过期
清除
导出
分享
解释
87 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
95 行
全部复制
67 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
82 行
全部复制
复制
已复制
复制
已复制
function Get-
S
POFolderFiles
function Get-
s
POFolderFiles
{
{
复制
已复制
复制
已复制
param
(
param
(
[Parameter(Mandatory
=
$true,Position
=
1)]
[Parameter(Mandatory
=
$true,Position
=
1)]
[string]$Username,
[string]$Username,
[Parameter(Mandatory
=
$true,Position
=
2)]
[Parameter(Mandatory
=
$true,Position
=
2)]
[string]$Url,
[string]$Url,
[Parameter(Mandatory
=
$true,Position
=
3)]
[Parameter(Mandatory
=
$true,Position
=
3)]
$password,
$password,
[Parameter(Mandatory
=
$true,Position
=
4)]
[Parameter(Mandatory
=
$true,Position
=
4)]
[string]$ListTitle
,
[string]$ListTitle
[Parameter(Mandatory=$true,Position=5)]
[string]$CSVPath
)
)
复制
已复制
复制
已复制
$ctx
=
New-Object Microsoft.SharePoint.Client.ClientContext
($Url)
$ctx
=
New-Object Microsoft.SharePoint.Client.ClientContext
($Url)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials
($Username,
$password)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials
($Username,
$password)
$ctx.Load($ctx.Web)
$ctx.Load($ctx.Web)
$ctx.ExecuteQuery()
$ctx.ExecuteQuery()
复制
已复制
复制
已复制
$ll
=
$ctx.Web.Lists.GetByTitle($ListTitle)
$ll
=
$ctx.Web.Lists.GetByTitle($ListTitle)
$ctx.Load($ll)
$ctx.Load($ll)
$ctx.ExecuteQuery()
$ctx.ExecuteQuery()
$spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery
$spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery
复制
已复制
复制
已复制
$spqQuery.ViewXml =
"<View Scope='RecursiveAll'
/
>";
$spqQuery.ViewXml =
"<View Scope='RecursiveAll'
><RowLimit>100</RowLimit></View
>";
$itemki
=
$ll.GetItems($spqQuery)
do {
$itemki
=
$ll.GetItems($spqQuery)
$ctx.Load($itemki)
$ctx.Load($itemki)
$ctx.ExecuteQuery()
$ctx.ExecuteQuery()
复制
已复制
复制
已复制
foreach
($item in $itemki)
foreach
($item in $itemki)
{
{
复制
已复制
复制
已复制
Write-Host $item["FileRef"]
Write-Host $item["FileRef"]
$file =
$file =
$ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]);
$ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]);
$ctx.Load($file)
$ctx.Load($file)
$ctx.Load($file.Versions)
$ctx.Load($file.Versions)
$ctx.ExecuteQuery()
$ctx.ExecuteQuery()
if ($file.Versions.Count -eq 0)
if ($file.Versions.Count -eq 0)
{
{
$obj
=
New-Object PSObject
$obj
=
New-Object PSObject
$obj | Add-Member NoteProperty ServerRelativeUrl
($file.ServerRelativeUrl)
$obj | Add-Member NoteProperty ServerRelativeUrl
($file.ServerRelativeUrl)
$obj | Add-Member NoteProperty FileLeafRef
($item["FileLeafRef"])
$obj | Add-Member NoteProperty FileLeafRef
($item["FileLeafRef"])
$obj | Add-Member NoteProperty Versions
("No Versions Available")
$obj | Add-Member NoteProperty Versions
("No Versions Available")
$obj | export-csv -Path $CSVPath -Append
}
}
else
else
{
{
$file.Versions.DeleteAll()
$file.Versions.DeleteAll()
复制
已复制
复制
已复制
try { $ctx.ExecuteQuery()
try { $ctx.ExecuteQuery()
$obj
=
New-Object PSObject
$obj
=
New-Object PSObject
$obj | Add-Member NoteProperty ServerRelativeUrl
($file.ServerRelativeUrl)
$obj | Add-Member NoteProperty ServerRelativeUrl
($file.ServerRelativeUrl)
$obj | Add-Member NoteProperty FileLeafRef
($item["FileLeafRef"])
$obj | Add-Member NoteProperty FileLeafRef
($item["FileLeafRef"])
$obj | Add-Member NoteProperty Versions
($file.Versions.Count + " versions were deleted")
$obj | Add-Member NoteProperty Versions
($file.Versions.Count + " versions were deleted")
$obj | export-csv -Path $CSVPath -Append
}
}
catch {
catch {
$obj
=
New-Object PSObject
$obj
=
New-Object PSObject
$obj | Add-Member NoteProperty ServerRelativeUrl
($file.ServerRelativeUrl)
$obj | Add-Member NoteProperty ServerRelativeUrl
($file.ServerRelativeUrl)
$obj | Add-Member NoteProperty FileLeafRef
($item["FileLeafRef"])
$obj | Add-Member NoteProperty FileLeafRef
($item["FileLeafRef"])
$obj | Add-Member NoteProperty Versions
($file.Versions.Count + " versions. Failed to delete")
$obj | Add-Member NoteProperty Versions
($file.Versions.Count + " versions. Failed to delete")
$obj | export-csv -Path $CSVPath -Append
}
}
}
}
复制
已复制
复制
已复制
复制
已复制
复制
已复制
}
}
$spqQuery.ListItemCollectionPosition = $itemki.ListItemCollectionPosition
} while ($itemki.ListItemCollectionPosition)
}
}
#Paths to SDK
#Paths to SDK
复制
已复制
复制
已复制
Add-Type -Path "
c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI
\Microsoft.SharePoint.Client.dll"
Add-Type -Path "
.\Lib
\Microsoft.SharePoint.Client.dll"
Add-Type -Path "
c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI
\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "
.\Lib
\Microsoft.SharePoint.Client.Runtime.dll"
#Enter the data
#Enter the data
复制
已复制
复制
已复制
$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
$Url
=
"https://
TODO-my
.sharepoint.com/
personal/TODO_SITE_NAME"
$username="trial@trialtrial125.onmicrosoft.com"
$Url
=
"https://
trialtrial125
.sharepoint.com/
sites/teamsitewithlibraries"
$ListTitle="Not-Empty-Document-Library"
$csvPath="C:\Users\ivo\Desktop\testpath114.csv"
复制
已复制
复制
已复制
$username = "TODO_USERNAME"
$AdminPassword = ConvertTo-SecureString -String "TODO_PASSWORD" -AsPlainText -Force
#$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
复制
已复制
复制
已复制
Get-sPOFolderFiles -User
n
ame $username -Url $Url -password $AdminPassword -ListTitle $ListTitle
-CSVPath $csvPath
#$ListTitle = "文档"
$ListTitle="Documents"
Get-sPOFolderFiles -User
N
ame $username -Url $Url -password $AdminPassword -ListTitle $ListTitle
已保存差异
原始文本
打开文件
function Get-SPOFolderFiles { param ( [Parameter(Mandatory=$true,Position=1)] [string]$Username, [Parameter(Mandatory=$true,Position=2)] [string]$Url, [Parameter(Mandatory=$true,Position=3)] $password, [Parameter(Mandatory=$true,Position=4)] [string]$ListTitle, [Parameter(Mandatory=$true,Position=5)] [string]$CSVPath ) $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password) $ctx.Load($ctx.Web) $ctx.ExecuteQuery() $ll=$ctx.Web.Lists.GetByTitle($ListTitle) $ctx.Load($ll) $ctx.ExecuteQuery() $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery $spqQuery.ViewXml ="<View Scope='RecursiveAll' />"; $itemki=$ll.GetItems($spqQuery) $ctx.Load($itemki) $ctx.ExecuteQuery() foreach($item in $itemki) { Write-Host $item["FileRef"] $file = $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); $ctx.Load($file) $ctx.Load($file.Versions) $ctx.ExecuteQuery() if ($file.Versions.Count -eq 0) { $obj=New-Object PSObject $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions("No Versions Available") $obj | export-csv -Path $CSVPath -Append } else { $file.Versions.DeleteAll() try { $ctx.ExecuteQuery() $obj=New-Object PSObject $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions were deleted") $obj | export-csv -Path $CSVPath -Append } catch { $obj=New-Object PSObject $obj | Add-Member NoteProperty ServerRelativeUrl($file.ServerRelativeUrl) $obj | Add-Member NoteProperty FileLeafRef($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions($file.Versions.Count + " versions. Failed to delete") $obj | export-csv -Path $CSVPath -Append } } } } #Paths to SDK Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" #Enter the data $AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString $username="trial@trialtrial125.onmicrosoft.com" $Url="https://trialtrial125.sharepoint.com/sites/teamsitewithlibraries" $ListTitle="Not-Empty-Document-Library" $csvPath="C:\Users\ivo\Desktop\testpath114.csv" Get-sPOFolderFiles -Username $username -Url $Url -password $AdminPassword -ListTitle $ListTitle -CSVPath $csvPath
更改后文本
打开文件
function Get-sPOFolderFiles { param( [Parameter(Mandatory = $true,Position = 1)] [string]$Username, [Parameter(Mandatory = $true,Position = 2)] [string]$Url, [Parameter(Mandatory = $true,Position = 3)] $password, [Parameter(Mandatory = $true,Position = 4)] [string]$ListTitle ) $ctx = New-Object Microsoft.SharePoint.Client.ClientContext ($Url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials ($Username,$password) $ctx.Load($ctx.Web) $ctx.ExecuteQuery() $ll = $ctx.Web.Lists.GetByTitle($ListTitle) $ctx.Load($ll) $ctx.ExecuteQuery() $spqQuery = New-Object Microsoft.SharePoint.Client.CamlQuery $spqQuery.ViewXml = "<View Scope='RecursiveAll'><RowLimit>100</RowLimit></View>"; do { $itemki = $ll.GetItems($spqQuery) $ctx.Load($itemki) $ctx.ExecuteQuery() foreach ($item in $itemki) { Write-Host $item["FileRef"] $file = $ctx.Web.GetFileByServerRelativeUrl($item["FileRef"]); $ctx.Load($file) $ctx.Load($file.Versions) $ctx.ExecuteQuery() if ($file.Versions.Count -eq 0) { $obj = New-Object PSObject $obj | Add-Member NoteProperty ServerRelativeUrl ($file.ServerRelativeUrl) $obj | Add-Member NoteProperty FileLeafRef ($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions ("No Versions Available") } else { $file.Versions.DeleteAll() try { $ctx.ExecuteQuery() $obj = New-Object PSObject $obj | Add-Member NoteProperty ServerRelativeUrl ($file.ServerRelativeUrl) $obj | Add-Member NoteProperty FileLeafRef ($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions ($file.Versions.Count + " versions were deleted") } catch { $obj = New-Object PSObject $obj | Add-Member NoteProperty ServerRelativeUrl ($file.ServerRelativeUrl) $obj | Add-Member NoteProperty FileLeafRef ($item["FileLeafRef"]) $obj | Add-Member NoteProperty Versions ($file.Versions.Count + " versions. Failed to delete") } } } $spqQuery.ListItemCollectionPosition = $itemki.ListItemCollectionPosition } while ($itemki.ListItemCollectionPosition) } #Paths to SDK Add-Type -Path ".\Lib\Microsoft.SharePoint.Client.dll" Add-Type -Path ".\Lib\Microsoft.SharePoint.Client.Runtime.dll" #Enter the data $Url = "https://TODO-my.sharepoint.com/personal/TODO_SITE_NAME" $username = "TODO_USERNAME" $AdminPassword = ConvertTo-SecureString -String "TODO_PASSWORD" -AsPlainText -Force #$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString #$ListTitle = "文档" $ListTitle="Documents" Get-sPOFolderFiles -UserName $username -Url $Url -password $AdminPassword -ListTitle $ListTitle
查找差异